diff --git a/home/user/.config/bash/aliases b/home/user/.config/bash/aliases index 630f835..f23318a 100644 --- a/home/user/.config/bash/aliases +++ b/home/user/.config/bash/aliases @@ -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' diff --git a/home/user/.config/bash/functions b/home/user/.config/bash/functions index 3600aff..d46e89a 100644 --- a/home/user/.config/bash/functions +++ b/home/user/.config/bash/functions @@ -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 } \ No newline at end of file