fix(tmux): Replace aliases that use empty flags with functions.

This commit is contained in:
detroyejr 2024-02-21 15:26:06 -05:00
commit 15c41e001a

View file

@ -37,14 +37,43 @@ 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'
alias tksv='tmux kill-server'
alias tkss='tmux kill-session -t'
alias tmuxconf='$EDITOR $ZSH_TMUX_CONFIG'
function ts() {
if [[ $@ == -* ]]; then
tmux new-session $@
else
tmux new-session ${@:+-s}$@
fi
}
function tkss() {
if [[ $@ == -* ]]; then
tmux kill-session $@
else
tmux kill-session ${@:+-t}$@
fi
}
function ta() {
if [[ $@ == -* ]]; then
tmux attach-session $@
else
tmux attach-session ${@:+-t}$@
fi
}
function tad() {
if [[ $@ == -* ]]; then
tmux attach-session -d $@
else
tmux attach-session -d ${@:+-t}$@
fi
}
# Determine if the terminal supports 256 colors
if [[ $terminfo[colors] == 256 ]]; then
export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR