Terminal: print of 'ls' is not utf-8 (gitbash in wt)

Created on 3 Apr 2020  路  7Comments  路  Source: microsoft/terminal

Issues

I added git bash in wt:

image

and when I input ls, then:

image

but when I open git bash (not using wt), it uses utf8:
image

how can I fix it?

Environment

Windows build number: windows10 1909 (10.0.18363.752)
Windows Terminal version (if applicable): 0.10.781.0

Issue-Question Needs-Tag-Fix Product-Terminal Resolution-Answered

Most helpful comment

-li means --login and --interactive. They're two important arguments to make sure that Bash gets started up in the right configuration. The git-for-windows folks let us know that we were missing it in our config example :smile:

All 7 comments

What is TERM, LANG, LC_ALL set to when running git bash in the Windows Terminal? What are their values when running in git bash directly?

What commandline are you providing for git bash in your profiles.json?

How to check them? "echo $LC_ALL" doesn't work.

the value of commandline : "commandline": "D:\Git\bin\bash.exe"

OK, I edit "bash.bashrc" in "%GITHOME%/Git/etc/".

add two lines in the tail:
export LANG="zh_CN.UTF-8"
export LC_ALL="zh_CN.UTF-8"

and it works.

thanks for your help!

but I still wonder why it works when I use git bash directly......

Try changing your commandline to end with bash.exe -li

Try changing your commandline to end with bash.exe -li

it works!

What does "-li" mean?

-li means --login and --interactive. They're two important arguments to make sure that Bash gets started up in the right configuration. The git-for-windows folks let us know that we were missing it in our config example :smile:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

carlos-zamora picture carlos-zamora  路  3Comments

miniksa picture miniksa  路  3Comments

wkbrd picture wkbrd  路  3Comments

alabuzhev picture alabuzhev  路  3Comments

ghvanderweg picture ghvanderweg  路  3Comments