mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
fix(tmux): Replace aliases that use empty flags with functions.
This commit is contained in:
parent
40ff950fcd
commit
15c41e001a
1 changed files with 33 additions and 4 deletions
|
|
@ -37,14 +37,43 @@ fi
|
||||||
: ${ZSH_TMUX_UNICODE:=false}
|
: ${ZSH_TMUX_UNICODE:=false}
|
||||||
|
|
||||||
# ALIASES
|
# ALIASES
|
||||||
alias ta='tmux attach -t'
|
|
||||||
alias tad='tmux attach -d -t'
|
|
||||||
alias ts='tmux new-session -s'
|
|
||||||
alias tl='tmux list-sessions'
|
alias tl='tmux list-sessions'
|
||||||
alias tksv='tmux kill-server'
|
alias tksv='tmux kill-server'
|
||||||
alias tkss='tmux kill-session -t'
|
|
||||||
alias tmuxconf='$EDITOR $ZSH_TMUX_CONFIG'
|
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
|
# 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…
Add table
Add a link
Reference in a new issue