23

it just happened on my Lion system, I am using zsh with tmux

normal in the zsh shell

enter image description here

double space in tmux screen

wider indention

am I missing some config in zsh or tmux?

2
  • I removed the vim tag since there is no relation with Vim. Or am I missing something in the question?
    – lucapette
    Commented Jun 28, 2012 at 6:28
  • it's ok @lucapette I will post the vim problem in a new question, thanks
    – Mike Li
    Commented Jun 28, 2012 at 6:29

3 Answers 3

27

Start tmux with the -u option for unicode functionality. See this issue.

From man tmux:

-u

tmux attempts to guess if the terminal is likely to support UTF-8 by checking the first of the LC_ALL, LC_CTYPE and LANG environment variables to be set for the string "UTF-8". This is not always correct: the -u flag explicitly informs tmux that UTF-8 is supported.

If the server is started from a client passed -u or where UTF-8 is detected, the utf8 and status-utf8 options are enabled in the global window and session options respectively.

3
  • exactly same with yours, I changed to another theme, same problem, but it's fine to just use zsh, only in the tmux screen, it's wider
    – Mike Li
    Commented Jun 28, 2012 at 6:17
  • 1
    add one more option ``set-option -g utf-8 on`
    – Kit Ho
    Commented Aug 11, 2013 at 4:13
  • Looks strange to me, but tmux -u has done the job, set-option lines were not enough.
    – Ixanezis
    Commented Oct 17, 2013 at 6:27
7

I ran into this problem with zsh, byobu and tmux.

To fully solve it:

  • Add the following to ~/.zshrc:

    export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8

  • Add -u after byobu-lauch in ~/.zprofile:

    _byobu_sourced=1 . /usr/bin/byobu-launch -u

  • Add the following to ~/.byobu/.tmux.conf:

    set-option -g utf-8 on

0

I had the same problem when I changed system language to English. When I use command locale all fields was empty. And when I set format language in preferences (Language & Region -> Advanced) to Russian - command locale was with filled values and in tmux it was ok.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.