From 9f60b627753bd2a25d6cd449f6fc2aee18e85c4d Mon Sep 17 00:00:00 2001 From: Peter Mosmans Date: Thu, 16 Jun 2016 11:05:09 +1000 Subject: [PATCH] Added support for forced unicode support When ZSH_TMUX_UNICODE=true then tmux is informed that UTF-8 is supported. --- plugins/tmux/tmux.plugin.zsh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index bc32c890..d9646ec2 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -34,6 +34,8 @@ if which tmux &> /dev/null # Tmux states this should be screen-256color, but you may need to change it on # systems without the proper terminfo [[ -n "$ZSH_TMUX_FIXTERM_WITH_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITH_256COLOR="screen-256color" + # Set '-u' option for unicode support + [[ -n "$ZSH_TMUX_UNICODE" ]] && ZSH_TMUX_UNICODE="-u" # Get the absolute path to the current directory @@ -63,15 +65,15 @@ if which tmux &> /dev/null # We have other arguments, just run them if [[ -n "$@" ]] then - \tmux $@ + \tmux $ZSH_TMUX_UNICODE $@ # Try to connect to an existing session. elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] then - \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` attach || \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` new-session + \tmux $ZSH_TMUX_UNICODE `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` attach || \tmux $ZSH_TMUX_UNICODE `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` new-session [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit # Just run tmux, fixing the TERM variable if requested. else - \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` + \tmux $ZSH_TMUX_UNICODE `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit fi }