Hacker News new | ask | show | jobs
by specialist 4500 days ago
Can someone share a use case or example of using tmux? Sorry for being thick, but I'm just not getting it.

I use iTerm. I use ssh to regularly access about 20 other boxes. I create tabs for every task. So I might have 3 tabs for a single box. 1 to start/stop processes, 1 to edit files, 1 to tail logs to verify my crap's working.

I installed tmux and I couldn't figure out what I'd use it for. This might be completely wrong, but I thought it'd allow me to control multiple boxes from a single session.

For example, I have 5 production servers that set up the same way. I want to do the same thing on all 5 at the same time. So my input/output is multiplexed to 5 boxes in a 1:5 relationship. Only I couldn't get that to work. I got lost switching sessions/contexts.

Again, sorry for being thick. I feel like I'm missing something great here.

3 comments

One use case: you are working away on a server via SSH at some café and suddenly the a internet dies on you. Oh crap, you had a ``make install`` running and now it will be half-baked because a dead SSH connection will HUP the process you were using.

With tmux, no HUP happens on the server side so the process keeps running. Once your internet connection comes back online you ssh back into the machine and ``tmux attach`` to the previous session. And voilĂ , it is like nothing happened. All of your output from before is still there too.

Not sure if you tried following for input/output multiplexing - * Create 5 panes, one for each server * Ctrl-b :setw synchronize-panes

This should synchronize the input to all panes i.e. type in any one and it will be sent to all 5. to turn it off, just run the same command again. I don't know if tmux has equivalent synchronize-windows.

My use case for TMux is simple:

It is always persistent so you have your tabs all set up on each server. You just attach to the sessions of TMux on the servers and don't have to ever create your complex scheme on your local machine. You can have them start on boot on the server and just attach to them via ssh.

My case I use WeeChat (IRC) on my home server always running and I just ssh to my server and attach to that session.