73

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
  • 733
  • 1
  • 6
  • 4

11 Answers11

71

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.

rkallensee
  • 1,994
  • 15
  • 12
60

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@'
Chris Johnsen
  • 214,407
  • 26
  • 209
  • 186
  • Thanks 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 :) – maplebonsai Dec 15 '11 at 23:47
  • Worked for me on Debian Squeeze, made the q's into - and the x's into |. – justCookin Jan 30 '14 at 14:56
  • Worked for me on Squeeze as well. Command to install tmux from backports is `sudo apt-get -t debian-backports install tmux`. – alexpls Jun 10 '14 at 01:50
  • squeeze 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. – Zarathustra Sep 14 '14 at 09:44
  • 1
    +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. – Ceredig Sep 06 '16 at 17:11
39

Try setting the character set to "UTF-8" and "Use Unicode line drawing code points" under Window -> Translation in your putty settings.

javamonk
  • 541
  • 5
  • 9
18

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)

renadeen
  • 1,741
  • 17
  • 16
  • 2
    tmux -u did the trick for me (cygwin mintty, mosh 1.4.2 and tmux) – muriloq Feb 20 '15 at 19:00
  • 6
    For 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. – elithrar Jun 22 '15 at 23:06
13

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':

PuTTY Translation Settings

Pavel Chuchuva
  • 22,633
  • 10
  • 99
  • 115
7

I ran thru the gamut of suggestions including:

  • confirming locale and UTF-8 setting in PuTTY
  • exporting NCURSES_NO_UT8_ACS=1
  • manually trying various fonts and PuTTY translation selections

Above did not work. Dialog displays showed qqqq... and xxxx with various corner characters.

Changing all dialog calls to include --ascii-lines was an option but it would involve a lot of script changes.

Best recommendation was to change the Remote Character Set to Use font encoding.

PuTTY Change Settings --> Window --> Translation --> Remote Character Set --> Use font encoding

Left all other PuTTY settings default.

E. Waldner
  • 81
  • 1
  • 4
  • If 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. – TryHarder Jul 09 '19 at 02:45
4

I changed the setting in Putty for terminal to Latin-1 and that seemed to fix the problem.

Kurt Peters
  • 161
  • 1
  • 7
3

If you are using KiTTY there is a check box under Windows -> Translation tab, that is called "Allow ACS line drawing in UTF". It needs to be checked:

enter image description here

Andrew Savinykh
  • 25,351
  • 17
  • 103
  • 158
2

For me the issue was I forgot to make a locale.conf file when I setup this Arch Linux box. Below line fixed the issue, substitute your own language. A reboot was not required for me.

echo "LANG=en_US.UTF-8" > /etc/locale.conf 
iBug
  • 35,554
  • 7
  • 89
  • 134
Lantorax
  • 21
  • 2
1

under windows/ putty the font you use has to have the characters for it to display set translation "UTF-8" and "Use Unicode line drawing code points" and font to "courier-new" and most of those problems go away

user250177
  • 11
  • 1
0

It seems the font choice is a confusing factor here, to wit:

  • Lucida sans doesn't display UTF-8 line drawing, only - + | (pipe) substitution
  • Courier New Bold does horizontal lines but | substitution for vertical
  • Courier New Normal does 'em all.
NoMann
  • 35
  • 6