Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iTerm2 to attach to tmux session using tabs instead of windows?

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.

like image 618
justingordon Avatar asked Nov 02 '13 22:11

justingordon


People also ask

How do you attach to an existing tmux session?

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 .

How do you use tmux on iTerm2?

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.

How do you attach and detach in tmux?

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.


1 Answers

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.

iterm2-windows-as-tabs

Solution found here

like image 125
Andrew Burns Avatar answered Oct 21 '22 13:10

Andrew Burns