Tmux borders displayed as x q instead of lines?
Solution 1
There is some mismatch between your terminal emulator and the terminfo database entry being used by tmux (the one named by the TERM environment variable when you start/attach to a tmux server).
Per the VT100 User Guide, Table 3-9: Special Graphics Characters, when the “special graphics set” is selected, x
is used to draw the “Vertical bar” and q
is used to draw “Horizontal line - Scan 5”.
Under terminfo, the VT100 special graphics characters are available as a part of the Alternate Character Set functionality; see the “Line Graphics” section of the terminfo(5) man page.
Probably (on your Debian server) the effective terminfo database entry indicates that ACS is available, but your terminal emulator is not actually responding to the specified control sequences.
The tmux CHANGES file indicates that some terminal emulators (e.g. Putty) do not respect the ACS control sequences when they are in UTF-8 mode. Thus, tmux 1.4 has a change that makes it always use UTF-8 characters instead of ACS sequences when the attaching client specifies that it can handle UTF-8 (i.e. when attaching, -u
was given or UTF-8
is present in LC_ALL, LC_CTYPE or LANG; the utf8
window option is about what tmux should expect from the programs it runs, not what it can send to the attached client).
Debian “squeeze” only includes tmux 1.3, so your tmux probably does not have the “prefer UTF-8 line drawing” feature (unless it pulls from a backports source).
If you can not fix your terminal emulator nor upgrade to at least tmux 1.4, then you might be able to use tmux’s terminal-overrides
option to unset the ACS-related capabilities so that tmux will fall back to ASCII line drawing. In your .tmux.conf
(on the Debian system):
set-option -ga terminal-overrides ',*:enacs@:smacs@:rmacs@:acsc@'
Solution 2
I had the same problem with PuTTY and Windows 8 when connecting to tmux running on a Debian Squeeze machine. Even when setting the charset to UTF-8 in PuTTY (in the settings under Window > Translation > Remote character set) I didn't get the correct line drawing.
Setting the Remote character set to "Use font encoding" did the trick for me.
Solution 3
Try setting the character set to "UTF-8" and "Use Unicode line drawing code points" under Window -> Translation in your putty settings.
Solution 4
I had the same problem with Putty when launching tmux on Linux 12.04 machine. Even setting the charset to UTF-8 in PuTTY (in the settings under Window > Translation > Remote character set) didn't solve the problem.
Launching tmux with -u option did the trick (tmux -u
)
Solution 5
If you have Putty 0.73 or higher open settings, expand Window category, then select Translation. Check 'Enable VT100 line drawing even in UTF-8 mode':
maplebonsai
Updated on July 05, 2022Comments
-
maplebonsai almost 2 years
I'm having trouble getting tmux to display lines for borders. They are being created with x and q. It's a debian squeeze server and the locale is set to en_US UTF8. I also tried adding
# instructs tmux to expect UTF-8 sequences setw -g utf8 on set -g status-utf8 on
lines to .tmux.conf. Nothing seems to work. I'm not sure if it's a locale issue or not. It displays correctly on other servers, but not the debian. I appreciate any tips you could offer! Thanks...
-
maplebonsai over 12 yearsThanks for all the tips...you were correct! Rather than continue trying to fix the install, I upgraded to 1.5 and it fixed the character problem. It looks great now :)
-
rascalking over 11 yearsFixed a similar problem I'd been having, but with a different character (an a with an accent mark) instead of q as the not-a-line character.
-
Battleroid over 11 yearsFor me I had to switch the charset Putty was using to UTF-8.
-
justCookin over 10 yearsWorked for me on Debian Squeeze, made the q's into - and the x's into |.
-
alexpls almost 10 yearsWorked for me on Squeeze as well. Command to install tmux from backports is
sudo apt-get -t debian-backports install tmux
. -
Zarathustra over 9 yearssqueeze does currenty have tmux 1.6. I had the problem that the client used always ASCII which does not work. I set it to
UTF-8
and everything went fine. -
muriloq about 9 yearstmux -u did the trick for me (cygwin mintty, mosh 1.4.2 and tmux)
-
elithrar almost 9 yearsFor reference,
tmux -u
forces tmux to operate in UTF-8 mode. By default it will attempt to detect based on the locale environmental variables provided by the terminal. PuTTY seems to pass incorrect or malformed UTF-8 variables and hence-u
just ignores that. -
Henry Rivera over 8 yearsI was having this issue on a Windows 8 box. Your suggestion fixed the issue. Thanks!
-
Ceredig over 7 years+1 for the explanation of Putty not supporting ACS+UTF. Kitty (Putty fork/enhancement) has an option to allow this (unchecked by default it seems). Solved a similar issue for me.
-
DM Karthik over 7 yearsit works for me too, the higher-rated answers work with centos 6,7 but with ubuntu16.04 this is the answer that worked.
-
Nick Weseman almost 7 yearsthis worked for me while higher suggestions did not.
-
TryHarder almost 5 yearsIf the above solution doesn't work for you, try opening up the settings while connected to the server and check that the configuration was applied properly. If it wasn't then reapply the changes,save config, exit tmux if open, then open tmux again.
-
Qin Heyang over 3 yearsNote that you need to detach (Crtl+b d) and attach (tmux a) to let the change take effect.
-
Ashfaq almost 3 yearsThanks for your answer! It helped me to solve the issue.