Tmux borders displayed as x q instead of lines?

57,532

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

PuTTY Translation Settings

Share:
57,532
maplebonsai
Author by

maplebonsai

Updated on July 05, 2022

Comments

  • maplebonsai
    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
    maplebonsai over 12 years
    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 :)
  • rascalking
    rascalking over 11 years
    Fixed 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
    Battleroid over 11 years
    For me I had to switch the charset Putty was using to UTF-8.
  • justCookin
    justCookin over 10 years
    Worked for me on Debian Squeeze, made the q's into - and the x's into |.
  • alexpls
    alexpls almost 10 years
    Worked for me on Squeeze as well. Command to install tmux from backports is sudo apt-get -t debian-backports install tmux.
  • Zarathustra
    Zarathustra over 9 years
    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.
  • muriloq
    muriloq about 9 years
    tmux -u did the trick for me (cygwin mintty, mosh 1.4.2 and tmux)
  • elithrar
    elithrar almost 9 years
    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.
  • Henry Rivera
    Henry Rivera over 8 years
    I was having this issue on a Windows 8 box. Your suggestion fixed the issue. Thanks!
  • Ceredig
    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
    DM Karthik over 7 years
    it 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
    Nick Weseman almost 7 years
    this worked for me while higher suggestions did not.
  • TryHarder
    TryHarder almost 5 years
    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.
  • Qin Heyang
    Qin Heyang over 3 years
    Note that you need to detach (Crtl+b d) and attach (tmux a) to let the change take effect.
  • Ashfaq
    Ashfaq almost 3 years
    Thanks for your answer! It helped me to solve the issue.