Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

weird space before prompt using tmux on Mac OS Lion

Tags:

zsh

tmux

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?

like image 203
Mike Li Avatar asked Jun 28 '12 02:06

Mike Li


2 Answers

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.

like image 195
Conner Avatar answered Nov 16 '22 03:11

Conner


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

like image 43
Druska Avatar answered Nov 16 '22 05:11

Druska