diff options
Diffstat (limited to '')
-rwxr-xr-x | bashrc/bin/t | 12 | ||||
-rw-r--r-- | bashrc/common/alias.sh | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/bashrc/bin/t b/bashrc/bin/t new file mode 100755 index 0000000..30c624e --- /dev/null +++ b/bashrc/bin/t @@ -0,0 +1,12 @@ +#!/bin/bash + +if [[ "x$1" == x ]] ; then + \tmux list-sessions &>/dev/null || + { + \tmux new-session -d + } + + exec \tmux attach-session -d +fi + +exec \tmux $@ diff --git a/bashrc/common/alias.sh b/bashrc/common/alias.sh index c1e9b6b..88220d5 100644 --- a/bashrc/common/alias.sh +++ b/bashrc/common/alias.sh @@ -50,3 +50,6 @@ unzip() { # screen autoresume alias screen="screen -xR" + +# tmux autoresume +hash tmux 2>/dev/null && alias tmux=t |