Why don't ANSI symbols work in PuTTY/Debian?
Solution 1:
The first problem is that you have $LC_ALL set to C
. If you set $LC_ALL, it will override all other locale settings, including $LANG. Since the "C" locale uses ISO-8859-1, tree
will not know about Unicode availability and will attempt to switch to the VT100 graphics codepage (there are four switchable codepages), which PuTTY refuses to do when expecting UTF-8. To fix this, stop setting LC_ALL in your environ and tree
will use Unicode graphics.
The second problem is that your $LANG variable is incorrect – you don't need to specify the charset twice. Set LANG=en_GB.UTF-8
to fix this.
The third problem is that you are forcing tree
to use VT100 graphics. Do not use the -A
option.
Keep PuTTY configured for UTF-8 as well.
(npm
is unaffected by this because it is hardcoded to use Unicode graphics regardless of locale.)