Skip to content

Instantly share code, notes, and snippets.

@ben-joostens
Created July 14, 2015 17:25
Show Gist options
  • Save ben-joostens/a8293bf921a627ae7829 to your computer and use it in GitHub Desktop.
Save ben-joostens/a8293bf921a627ae7829 to your computer and use it in GitHub Desktop.
Start TMUX when logging in (fish shell)
#
# From: http://unix.stackexchange.com/questions/121401/how-can-i-start-tmux-automatically-in-fish-shell-while-connecting-to-remote-serv
#
if status --is-login
set PPID (echo (ps --pid %self -o ppid --no-headers) | xargs)
if ps --pid $PPID | grep ssh
tmux has-session -t remote; and tmux attach-session -t remote; or tmux new-session -s remote; and kill %self
echo "tmux failed to start; using plain fish shell"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment