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

1

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?

Clingy answered 13/6, 2016 at 17:35 Comment(2)
You can look into tmux-resurrect plugin github.com/tmux-plugins/tmux-resurrectConcertino
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 disappointedApothem
V
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
Voccola answered 14/11, 2016 at 10:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.