Add auto-tmux on ssh
This commit is contained in:
5
.bashrc
5
.bashrc
@@ -8,6 +8,11 @@ case $- in
|
||||
*) return;;
|
||||
esac
|
||||
|
||||
# Auto-launch tmux on SSH connection
|
||||
if [[ -n "$SSH_CONNECTION" ]] && [[ -z "$TMUX" ]] && command -v tmux &> /dev/null; then
|
||||
tmux attach-session -t default || tmux new-session -s default
|
||||
fi
|
||||
|
||||
# don't put duplicate lines or lines starting with space in the history.
|
||||
# See bash(1) for more options
|
||||
HISTCONTROL=ignoreboth
|
||||
|
||||
Reference in New Issue
Block a user