zsh tmux powerline 多线,正常运行

zsh tmux powerline multiple lines, normal operation

这是我的.tmux.conf

set-option -g default-shell /bin/zsh
set -g mode-mouse on

# use UTF8
set -g utf8
set-window-option -g utf8 on

shell "powerline-daemon -q"
source "/Users/lighter/Library/Python/2.7/lib/python/site-packages/powerline/bindings/tmux/powerline.conf"

 ~ > python --version
Python 2.7.10
 ~ > pip --version
pip 7.1.2 from /usr/local/lib/python2.7/site-packages (python 2.7)
 ~ > vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 16 2015 15:31:56)

而当我输入tmux时,我不能正常操作,跳多条电源线。我该如何解决它。我搜索了很多,但不适合我。谢谢你的帮助。

首先,在您的 zshrc 中添加 LANG 设置,例如 export LANG=en_US.UTF-8

接下来,如果您使用 iTerm2,请尝试以下操作。

iTerm > 首选项 > 配置文件 > 文本
在 "Double-Width Characters".

处取消选中 "Treat ambiguous-width characters as double width"

或Terminal.app,试试这个。

终端 > 首选项 > 配置文件 > 高级
在 "International" 处取消选中 "Unicode East Asian Ambiguous characters are wide"。

我认为这会解决问题,但如果您使用 CJK 语言,可能会导致另一个问题。

例如,vim在tmux中,非ascii字符(“☆”、“※”、“♪”...)将被视为ascii。
为避免这种情况,您必须使用 these gist.
修补 tmux 之后,检查上面这些未检查的选项,它会正常工作:)