alias q to detach tmux
This commit is contained in:
parent
37c0ef2741
commit
37eb4339fe
@ -99,7 +99,14 @@ alias dcd='docker-compose down'
|
||||
alias drmc='docker container prune'
|
||||
alias drmi='docker image prune'
|
||||
|
||||
|
||||
# tmux
|
||||
if [[ -n "$TMUX" ]]; then
|
||||
alias q='tmux detach'
|
||||
else
|
||||
alias q='exit 0'
|
||||
fi
|
||||
|
||||
alias td='tmux detach'
|
||||
|
||||
|
||||
|
||||
@ -221,20 +221,4 @@ most-often-commands() {
|
||||
# Disable tmux on remote machine
|
||||
ssht() {
|
||||
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