6

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?

Amet Alvirde
  • 1,453
  • 3
  • 13
  • 22
  • You can look into tmux-resurrect plugin https://github.com/tmux-plugins/tmux-resurrect – Sardorbek Imomaliev Jul 07 '16 at 04:12
  • tmux-ressurect is really cool **but** it doesn't store environment variables. So if you use `rvm` and need different versions of ruby for each session, then you'll be really disappointed – Oleg Tsymbalyuk Nov 24 '16 at 17:40

1 Answers1

2

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
Bajena
  • 181
  • 2
  • 9