I got tmuxinator to work with iTerm2 the following: https://stackoverflow.com/a/19747819/1009332
However, each tab initially opens in a different window. Is there any way to attach to an existing tmux session using tabs rather than new windows?
There's some more info about this cool feature here: https://code.google.com/p/iterm2/wiki/TmuxIntegration
My motivation for this was: 1. copy/paste/find locks the process in tmux, whereas with iterm2, you can find in a tail of logs and not lock the process. 2. key bindings are simpler in iTerm2. 3. I like tmuxinator to start many shell windows (tabs) when doing rails web development, so that my stdout of different processes goes to different windows, rather than mixing together when using foreman.
Basic Tmux Usage On the command prompt, type tmux new -s my_session , Run the desired program. Use the key sequence Ctrl-b + d to detach from the session. Reattach to the Tmux session by typing tmux attach-session -t my_session .
The first key combination (ctrl+b) puts tmux into command mode. The percent tells tmux to split the window vertically. Even moving between the vertical panes takes two keyboard interactions. The first is ctrl+b which puts tmux into command mode.
Detach From A Session To detach (meaning exit the window to come back to later) from the tmux session, use CTRL + b then d (hold ctrl, press b, let go of both of the keys, and press d). Whatever program(s) you are running in the tmux session will continue going without you.
It is an option in iTerm2: Preferences > general
Open tmux windows as native tabs in a new window
, but you have to disconnect then reconnect.
Solution found here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With