Amet Alvirde
Amet Alvirde

Reputation: 1483

How to start two or more tmux (or tmuxinator) sessions simultaneously?

I'm a huge fan of tmux + tmuxinator. Buy recently I found myself working with different sessions, and despite I configured'em with tmuxinator, I still need to open one at a time every day.

Is there a way to open two or more sessions at once so I can navigate between them as soon as I start tmux ot tmuxinator?

Upvotes: 6

Views: 892

Answers (1)

Bajena
Bajena

Reputation: 181

Check out this little mac os script I wrote:

#!/bin/bash
sessions=( session1 session2 )
for i in "${sessions[@]}"
do
osascript <<EOF
  tell application "iTerm" to activate
  tell application "System Events" to tell process "iTerm" to keystroke "t" using command down
  tell application "System Events" to tell process "iTerm" to keystroke "tmuxinator start ${i}"
  tell application "System Events" to tell process "iTerm" to key code 52
EOF
done

Upvotes: 2

Related Questions