mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-21 23:33:21 +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}
|
||||
|
||||
# ALIASES
|
||||
alias ta='tmux attach -t'
|
||||
alias tad='tmux attach -d -t'
|
||||
alias ts='tmux new-session -s'
|
||||
alias tl='tmux list-sessions'
|
||||
function _build_tmux_alias {
|
||||
eval "function $1 {
|
||||
if [[ -z \$1 ]] || [[ \${1::1} == '-' ]]; then
|
||||
tmux $2 \"\$@\"
|
||||
else
|
||||
tmux $2 $3 \"\$@\"
|
||||
fi
|
||||
}"
|
||||
}
|
||||
|
||||
alias tksv='tmux kill-server'
|
||||
alias tkss='tmux kill-session -t'
|
||||
alias tl='tmux list-sessions'
|
||||
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
|
||||
if [[ $terminfo[colors] == 256 ]]; then
|
||||
export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR
|
||||
|
Loading…
Reference in New Issue
Block a user