0

Following one of the comments of one of the responses to this question I've set my default shell to /usr/bin/tmux, which works perfectly fine.

But now I'd like if I could assign all logins to one account to be attached to the same window-group. As per this gist that works by adding new-session -s main to ~/.tmux.conf and then invoking tmux as tmux new-session -t main

Is there a way to have this be invoked as the login shell, or have tmux itself attach to the "main" window-group on launch by default?

toman
  • 1

1 Answers1

0
if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then
   exec /usr/bin/tmux new-session -t main
fi

Added to the end of my .bashrc seems to do this as I wanted.

toman
  • 1