I use ♪
character in my zsh
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 in tmux
?
My zsh-theme:
PROMPT='%{$fg_bold[cyan]%} ♪ %{$fg[blue]%}%c%{$fg_bold[blue]%}$(git_prompt_info)$(git_remote_status)%{$fg_bold[blue]%} % %{$reset_color%}'
Starting tmux with
u
flag solves this issueI've created an alias of tmux in my zshrc
Thanks for the flag part, but we can also set the below to the profile rc (e.g.
.zshrc
orbashrc
) fileWith this option set, no need to use the -u flag.
If u use diffrent shell like "fish" or sh u can change enviroment variable of tmux
$ tmux setenv 'LC_ALL' 'en_IN.UTF-8'
$ tmux setenv 'LANG' 'en_IN.UTF-8'
$ tmux show-environment