Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tmux borders displayed as x q instead of lines?

Tags:

utf-8

tmux

debian

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...

like image 620
maplebonsai Avatar asked Dec 13 '11 02:12

maplebonsai


6 Answers

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.

like image 159
rkallensee Avatar answered Oct 16 '22 17:10

rkallensee


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@'
like image 28
Chris Johnsen Avatar answered Oct 16 '22 17:10

Chris Johnsen


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)

like image 18
renadeen Avatar answered Oct 16 '22 18:10

renadeen


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

like image 39
javamonk Avatar answered Oct 16 '22 17:10

javamonk


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

like image 12
Pavel Chuchuva Avatar answered Oct 16 '22 17:10

Pavel Chuchuva


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.

like image 7
E. Waldner Avatar answered Oct 16 '22 18:10

E. Waldner