feat(zsh): if tmux session ask to exit
This commit is contained in:
parent
933b1fc1d8
commit
154d778f7c
@ -38,7 +38,6 @@ alias path='echo -e ${PATH//:/\\n}'
|
|||||||
|
|
||||||
# shorts
|
# shorts
|
||||||
alias c='clear'
|
alias c='clear'
|
||||||
alias q='exit 0'
|
|
||||||
alias h='history 0'
|
alias h='history 0'
|
||||||
alias j='jobs -l'
|
alias j='jobs -l'
|
||||||
|
|
||||||
|
|||||||
@ -222,3 +222,19 @@ most-often-commands() {
|
|||||||
ssht() {
|
ssht() {
|
||||||
ssh -t "$1" 'TMUX=NO $SHELL -l'
|
ssh -t "$1" 'TMUX=NO $SHELL -l'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
q() {
|
||||||
|
if [[ -n "$TMUX" ]]; then
|
||||||
|
local REPLY
|
||||||
|
echo -n "Tmux session - you really want to exit? [Y/n] "
|
||||||
|
read REPLY
|
||||||
|
|
||||||
|
if [[ "$REPLY" == [Yy]* ]]; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "Press 'Ctrl+b d' to detach tmux session"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user