UTF-8 character not showing properly in tmux
24,754
Solution 1
Starting tmux with u
flag solves this issue
tmux -u
I've created an alias of tmux in my zshrc
alias tmux='tmux -u'
Solution 2
Thanks for the flag part, but we can also set the below to the profile rc (e.g. .zshrc
or bashrc
) file
export LC_ALL=en_IN.UTF-8
export LANG=en_IN.UTF-8
With this option set, no need to use the -u flag.
Related videos on Youtube
Author by
Sourabh
Updated on September 18, 2022Comments
-
Sourabh over 1 year
I use
♪
character in myzsh
theme's for prompt. But in tmux, my prompt was behaving weirdly, showing extra spaces, like this:♪ ~ 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
I recently discovered that I can set tmux encoding to utf8 by
set-window-option -g utf8 on
. Doing that, the space problem was gone but♪
character changed to_
. How can I get my♪
back intmux
?My zsh-theme:
PROMPT='%{$fg_bold[cyan]%} ♪ %{$fg[blue]%}%c%{$fg_bold[blue]%}$(git_prompt_info)$(git_remote_status)%{$fg_bold[blue]%} % %{$reset_color%}'
-
user.dz over 10 yearsI couldn't get
set-window-option
to work for menot found cmd
. Please, could write exact steps to reproduce it. -
Sourabh about 10 years
-
-
Dave Amit over 7 yearsThanks for the flag! It was so frustrating with all the gibberish when using tmux and nvim would go crazy with powerline! This solved the issue! Thanks again.
-
shellbye over 7 years
-
Tim Visee over 5 yearsInteresting. I thought setting
set -g utf8 on
in~/.tmux.conf
would solve this issue, but apparently it didn't. Using the flag explicitly when callingtmux
does works though. Thanks a lot, you saved me a lot of hassle! -
Ehsan Kia over 4 yearsFor what it's worth, this recently broke for me, turns out it was due to me adding LC_ALL=C to my config, which forced ascii encoding.
-
Yesh over 2 yearsThis works only if pasted above
source $ZSH/oh-my-zsh.sh