UTF-8 line-drawing characters do not render correctly in Terminal vs. console #3130

Closed
opened 2026-01-30 23:13:46 +00:00 by claunia · 15 comments
Owner

Originally created by @cerebrate on GitHub (Aug 5, 2019).

(This may well be a duplicate, but I didn't find a specific duplicate and I'm not clueful enough to figure out if it's included in any of the others.)

Environment

Windows build number: 10.0.18945.1001
Windows Terminal version (if applicable): 0.3.2142.0

Any other software?

Reproduced using Debian Buster; also, font in use in both Terminal and console is Consolas.

Steps to reproduce

  1. Ensure that you are configured to use the UTF-8 locale and UTF-8 codeset; i.e., that the output of the locale command is as follows:
LANG=en_US.UTF-8                                                                                                                                            LANGUAGE=en_US.UTF-8                                                                                                                                        LC_CTYPE="en_US.UTF-8"                                                                                                                                      LC_NUMERIC="en_US.UTF-8"                                                                                                                                    LC_TIME="en_US.UTF-8"                                                                                                                                       LC_COLLATE="en_US.UTF-8"                                                                                                                                    LC_MONETARY="en_US.UTF-8"                                                                                                                                   LC_MESSAGES="en_US.UTF-8"                                                                                                                                   LC_PAPER="en_US.UTF-8"                                                                                                                                      LC_NAME="en_US.UTF-8"                                                                                                                                       LC_ADDRESS="en_US.UTF-8"                                                                                                                                    LC_TELEPHONE="en_US.UTF-8"                                                                                                                                  LC_MEASUREMENT="en_US.UTF-8"                                                                                                                                LC_IDENTIFICATION="en_US.UTF-8"                                                                                                                             LC_ALL=en_US.UTF-8 
  1. Run pstree, or another command which detects and uses UTF-8 line-drawing characters.

Note that this is not the default configuration of Debian for the en_US.UTF-8 locale, which leaves LC_ALL set to C; sudo update-locale LC_ALL=en_US.UTF-8 is required.

Expected behavior

Actual behavior

Expected behavior is line-drawing characters, as seen in console on the right. Actual behavior is all such characters rendering as "underline", as seen in Terminal on the left.

bad-linedrawing

Originally created by @cerebrate on GitHub (Aug 5, 2019). (This may well be a duplicate, but I didn't find a specific duplicate and I'm not clueful enough to figure out if it's included in any of the others.) # Environment ```none Windows build number: 10.0.18945.1001 Windows Terminal version (if applicable): 0.3.2142.0 Any other software? Reproduced using Debian Buster; also, font in use in both Terminal and console is Consolas. ``` # Steps to reproduce 1. Ensure that you are configured to use the UTF-8 locale and UTF-8 codeset; i.e., that the output of the `locale` command is as follows: ``` LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=en_US.UTF-8 ``` 2. Run `pstree`, or another command which detects and uses UTF-8 line-drawing characters. Note that this is not the default configuration of Debian for the en_US.UTF-8 locale, which leaves LC_ALL set to C; `sudo update-locale LC_ALL=en_US.UTF-8` is required. # Expected behavior # Actual behavior Expected behavior is line-drawing characters, as seen in console on the right. Actual behavior is all such characters rendering as "underline", as seen in Terminal on the left. ![bad-linedrawing](https://user-images.githubusercontent.com/371623/62431251-72235a00-b6eb-11e9-9d7f-77682dbd8fcb.jpg)
Author
Owner

@DHowett-MSFT commented on GitHub (Aug 5, 2019):

It looks like this is in tmux or screen. Can you share the value of $TERM inside and outside your multiplexer?

@DHowett-MSFT commented on GitHub (Aug 5, 2019): It looks like this is in tmux or screen. Can you share the value of `$TERM` inside and outside your multiplexer?
Author
Owner

@cerebrate commented on GitHub (Aug 5, 2019):

Outside, it’s xterm-256color. Inside, it’s screen-256color.

I should add, though, that I also thought it might be tmux-related, so I tried the same experiment without it running. Same results.

@cerebrate commented on GitHub (Aug 5, 2019): Outside, it’s xterm-256color. Inside, it’s screen-256color. I should add, though, that I also thought it might be tmux-related, so I tried the same experiment without it running. Same results.
Author
Owner

@zadjii-msft commented on GitHub (Aug 5, 2019):

@cerebrate What font are you using? Is en-us.UTF-8 important? I'm working with C.UTF-8 over here, and that seems just fine.

Curiously also, in the conhost.exe window on the right, you have LANG=C.UTF-8.

@zadjii-msft commented on GitHub (Aug 5, 2019): @cerebrate What font are you using? Is `en-us.UTF-8` important? I'm working with `C.UTF-8` over here, and that seems just fine. Curiously also, in the conhost.exe window on the right, you have `LANG=C.UTF-8`.
Author
Owner

@DHowett-MSFT commented on GitHub (Aug 5, 2019):

Hm. Can you run

pstree -G
pstree -A
pstree -U

in both conhost and Terminal?

@DHowett-MSFT commented on GitHub (Aug 5, 2019): Hm. Can you run ``` pstree -G pstree -A pstree -U ``` in both conhost and Terminal?
Author
Owner

@cerebrate commented on GitHub (Aug 6, 2019):

@zadjii-msft Consolas.

And I'm using en-US.UTF-8 rather than C.UTF-8 primarily for collation reasons; I do a fair amount of work with non-ASCII characters, which en-US.UTF-8 sorts correctly and C.UTF-8 does not.

@cerebrate commented on GitHub (Aug 6, 2019): @zadjii-msft Consolas. And I'm using `en-US.UTF-8` rather than `C.UTF-8` primarily for collation reasons; I do a fair amount of work with non-ASCII characters, which `en-US.UTF-8` sorts correctly and `C.UTF-8` does not.
Author
Owner

@cerebrate commented on GitHub (Aug 6, 2019):

@DHowett-MSFT Well, this is awkward.

Since reporting this issue yesterday, and without me intentionally changing anything (font, locale, etc.), it is now working - i.e., rendering with line-drawing characters in Terminal, as well as in conhost. Behavior on running the three commands in either is as expected: -G and -U render with line-drawing characters, -A with ASCII art, and no underlines are to be seen.

And so far, I can't seem to break it again. Gah. I hate heisenbugs.

Leaving this open for now, and I'll try tomorrow to repro it on another machine still running on installation defaults.

@cerebrate commented on GitHub (Aug 6, 2019): @DHowett-MSFT Well, this is awkward. Since reporting this issue yesterday, and without me intentionally changing anything (font, locale, etc.), it is now working - i.e., rendering with line-drawing characters in Terminal, as well as in conhost. Behavior on running the three commands in either is as expected: -G and -U render with line-drawing characters, -A with ASCII art, and no underlines are to be seen. And so far, I can't seem to break it again. Gah. I _hate_ heisenbugs. Leaving this open for now, and I'll try tomorrow to repro it on another machine still running on installation defaults.
Author
Owner

@nicm commented on GitHub (Aug 6, 2019):

tmux will draw all UTF-8 characters as underscores if it thinks the terminal does not support UTF-8, perhaps that is the case here. Are you sure at least one of LANG, LC_ALL or LC_CTYPE is set correctly outside tmux? You can also use -u to tell tmux explicitly that the terminal supports UTF-8.

@nicm commented on GitHub (Aug 6, 2019): tmux will draw all UTF-8 characters as underscores if it thinks the terminal does not support UTF-8, perhaps that is the case here. Are you sure at least one of LANG, LC_ALL or LC_CTYPE is set correctly *outside* tmux? You can also use -u to tell tmux explicitly that the terminal supports UTF-8.
Author
Owner

@DHowett-MSFT commented on GitHub (Aug 8, 2019):

I'll close this one out in light of "tmux ... underscores ...". Thanks!

@DHowett-MSFT commented on GitHub (Aug 8, 2019): I'll close this one out in light of "tmux ... underscores ...". Thanks!
Author
Owner

@cerebrate commented on GitHub (Aug 8, 2019):

@nicm Trouble is, the same thing was happening outside tmux, per comment above: https://github.com/microsoft/terminal/issues/2243#issuecomment-518049785 ; just bypassing all my normal .zprofile / .zcshrc and starting up in bash alone.

On the other hand, since I can't get the issue to reproduce, yeah, might as well go ahead and close it/leave it closed.

@cerebrate commented on GitHub (Aug 8, 2019): @nicm Trouble is, the same thing was happening outside tmux, per comment above: https://github.com/microsoft/terminal/issues/2243#issuecomment-518049785 ; just bypassing all my normal .zprofile / .zcshrc and starting up in bash alone. On the other hand, since I can't get the issue to reproduce, yeah, might as well go ahead and close it/leave it closed.
Author
Owner

@iamkentleom commented on GitHub (May 26, 2020):

I had the same issue. Probably there's something wrong with the rendering/screen because I've tried making the font bigger and everything came back to normal. Probably the font is small enough that the rendered line can't be seen.

@iamkentleom commented on GitHub (May 26, 2020): I had the same issue. Probably there's something wrong with the rendering/screen because I've tried making the font bigger and everything came back to normal. Probably the font is small enough that the rendered line can't be seen.
Author
Owner

@ivho commented on GitHub (Oct 12, 2021):

I had the same issue. I'm running tmux on a server that I'm not root on so I can't change my default shell from tcsh to bash. If I start tmux directly from tcsh I get the underscores, if I detach, start bash and attach to tmux again it rerenders the output and it looks fine, i.e I don't even have to rerun pstree. $TERM is xterm-256color in both bash and tcsh.

edit: tmux v3.0

@ivho commented on GitHub (Oct 12, 2021): I had the same issue. I'm running tmux on a server that I'm not root on so I can't change my default shell from tcsh to bash. If I start tmux directly from tcsh I get the underscores, if I detach, start bash and attach to tmux again it rerenders the output and it looks fine, i.e I don't even have to rerun pstree. $TERM is xterm-256color in both bash and tcsh. edit: tmux v3.0
Author
Owner

@DHowett commented on GitHub (Oct 12, 2021):

Curious! @ivho what's the output of locale? (From both shells)

@DHowett commented on GitHub (Oct 12, 2021): Curious! @ivho what's the output of `locale`? (From both shells)
Author
Owner

@ivho commented on GitHub (Oct 12, 2021):

 [17:50] [/home/xxx] -> locale
LANG=en_US
LC_CTYPE="en_US"
LC_NUMERIC=sv_SE.UTF-8
LC_TIME=C
LC_COLLATE=C
LC_MONETARY=sv_SE.UTF-8
LC_MESSAGES=C
LC_PAPER=sv_SE.UTF-8
LC_NAME=sv_SE.UTF-8
LC_ADDRESS=sv_SE.UTF-8
LC_TELEPHONE=sv_SE.UTF-8
LC_MEASUREMENT=sv_SE.UTF-8
LC_IDENTIFICATION=sv_SE.UTF-8
LC_ALL=
 [17:50] [xxx] -> bash
nn@xx:~$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

@ivho commented on GitHub (Oct 12, 2021): ``` [17:50] [/home/xxx] -> locale LANG=en_US LC_CTYPE="en_US" LC_NUMERIC=sv_SE.UTF-8 LC_TIME=C LC_COLLATE=C LC_MONETARY=sv_SE.UTF-8 LC_MESSAGES=C LC_PAPER=sv_SE.UTF-8 LC_NAME=sv_SE.UTF-8 LC_ADDRESS=sv_SE.UTF-8 LC_TELEPHONE=sv_SE.UTF-8 LC_MEASUREMENT=sv_SE.UTF-8 LC_IDENTIFICATION=sv_SE.UTF-8 LC_ALL= [17:50] [xxx] -> bash nn@xx:~$ locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=en_US.UTF-8 ```
Author
Owner

@DHowett commented on GitHub (Oct 12, 2021):

I suspect that the missing .UTF-8 on LANG (and perhaps the empty LC_ALL?) are contributing to tmux's decision to remove the UTF-8 characters from its output. 😄

@DHowett commented on GitHub (Oct 12, 2021): I suspect that the missing `.UTF-8` on `LANG` (and perhaps the empty `LC_ALL`?) are contributing to tmux's decision to remove the UTF-8 characters from its output. :smile:
Author
Owner

@ivho commented on GitHub (Oct 12, 2021):

oops, just realized this is the microsoft/terminal repo, not tmux :-) I'm on a pure linux setup both client and server

@ivho commented on GitHub (Oct 12, 2021): oops, just realized this is the microsoft/terminal repo, not tmux :-) I'm on a pure linux setup both client and server
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3130