Sou*_*abh 33 prompt utf-8 tmux
我?在我的zsh主题中使用字符来提示。但是在 tmux 中,我的提示表现得很奇怪,显示了额外的空格,如下所示:
? ~ I can type from here
? ~ Instead of here like in zsh, and sometimes when I do stuff like cd
? ~ cd ~
? ~ cdcd /
? ~ ^^These 2 chars just show up but are not actually part of command and not delete-able
Run Code Online (Sandbox Code Playgroud)
我最近发现我可以通过 .tmux 将 tmux 编码设置为 utf8 set-window-option -g utf8 on。这样做,空间问题消失了,但?字符变为_. 我怎样才能?回来tmux?
我的 zsh 主题:
PROMPT='%{$fg_bold[cyan]%} ? %{$fg[blue]%}%c%{$fg_bold[blue]%}$(git_prompt_info)$(git_remote_status)%{$fg_bold[blue]%} % %{$reset_color%}'
Run Code Online (Sandbox Code Playgroud)
Sou*_*abh 53
用u标志启动 tmux解决了这个问题
tmux -u
Run Code Online (Sandbox Code Playgroud)
我在 zshrc 中创建了 tmux 的别名
alias tmux='tmux -u'
Run Code Online (Sandbox Code Playgroud)
小智 13
感谢您的标志部分,但我们也可以将以下内容设置为配置文件 rc (例如.zshrc或bashrc)文件
export LC_ALL=en_IN.UTF-8
export LANG=en_IN.UTF-8
Run Code Online (Sandbox Code Playgroud)
设置此选项后,无需使用 -u 标志。