Petar Vasilev
Petar Vasilev

Reputation: 4755

Make TMUX active whenever I start a new shell session on OSX

I'm trying to start tmux automatically whenever I open a new shell, just note I'm using iTerm on OSX, I've tried putting the following in my .bashrc file:

if [[ ! $TERM =~ screen ]]; then
    exec tmux
fi

this doesn't work, though I've tested it on Ubuntu and it works just fine.

Any help appreciated.

Upvotes: 0

Views: 900

Answers (2)

Petar Vasilev
Petar Vasilev

Reputation: 4755

Turns out my .bashrc file wasn't loaded properly off the .bash_profile so I just had to move my scripts and settings to .bash_profile

Upvotes: 1

Kent
Kent

Reputation: 195269

with your codes, what happens if you start 10 terminals?

you can check the output of tmux list-sessions to decide if tmux has already started.

Upvotes: 1

Related Questions