mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-22 07:43:31 +01:00
fix(tmux): do not pass empty flags to aliases (#12232)
This enables compatibility with tmux >3.3a Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
This commit is contained in:
parent
6a65ac9025
commit
65b23a3328
@ -47,14 +47,27 @@ fi
|
|||||||
: ${ZSH_TMUX_UNICODE:=false}
|
: ${ZSH_TMUX_UNICODE:=false}
|
||||||
|
|
||||||
# ALIASES
|
# ALIASES
|
||||||
alias ta='tmux attach -t'
|
function _build_tmux_alias {
|
||||||
alias tad='tmux attach -d -t'
|
eval "function $1 {
|
||||||
alias ts='tmux new-session -s'
|
if [[ -z \$1 ]] || [[ \${1::1} == '-' ]]; then
|
||||||
alias tl='tmux list-sessions'
|
tmux $2 \"\$@\"
|
||||||
|
else
|
||||||
|
tmux $2 $3 \"\$@\"
|
||||||
|
fi
|
||||||
|
}"
|
||||||
|
}
|
||||||
|
|
||||||
alias tksv='tmux kill-server'
|
alias tksv='tmux kill-server'
|
||||||
alias tkss='tmux kill-session -t'
|
alias tl='tmux list-sessions'
|
||||||
alias tmuxconf='$EDITOR $ZSH_TMUX_CONFIG'
|
alias tmuxconf='$EDITOR $ZSH_TMUX_CONFIG'
|
||||||
|
|
||||||
|
_build_tmux_alias "ta" "attach" "-t"
|
||||||
|
_build_tmux_alias "tad" "attach -d" "-t"
|
||||||
|
_build_tmux_alias "ts" "new-session" "-s"
|
||||||
|
_build_tmux_alias "tkss" "kill-session" "-t"
|
||||||
|
|
||||||
|
unfunction _build_tmux_alias
|
||||||
|
|
||||||
# Determine if the terminal supports 256 colors
|
# Determine if the terminal supports 256 colors
|
||||||
if [[ $terminfo[colors] == 256 ]]; then
|
if [[ $terminfo[colors] == 256 ]]; then
|
||||||
export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR
|
export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR
|
||||||
|
Loading…
Reference in New Issue
Block a user