diff options
Diffstat (limited to 'bash/bashrc.d/tmux.bash')
-rw-r--r-- | bash/bashrc.d/tmux.bash | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/bash/bashrc.d/tmux.bash b/bash/bashrc.d/tmux.bash index 1d192f46..1718b103 100644 --- a/bash/bashrc.d/tmux.bash +++ b/bash/bashrc.d/tmux.bash @@ -5,22 +5,18 @@ fi # Attach to existing tmux session rather than create a new one if possible tmux() { - local -a tcmd # If given any arguments, just use them as they are if (($#)) ; then - tcmd=("$@") + command tmux "$@" # If a session exists, just attach to it elif command tmux has-session 2>/dev/null ; then - tcmd=(attach-session -d) + command tmux attach-session -d # Create a new session with an appropriate name else - tcmd=(new-session -s "${TMUX_SESSION:-default}") + command tmux new-session -s "${TMUX_SESSION:-default}" fi - - # Run tmux command with concluded arguments - command tmux "${tcmd[@]}" } |