Have you ever needed to run a long-running job over SSH? If your command is still running and SSH disconnects, your command gets terminated. You can work around this by using nohup like this: `nohup <command> &` to launch your program.
Tmux is kind of like nohup, but for the whole shell. If you SSH into a terminal and start tmux, it'll give you a shell that survives disconnect/reconnect.
Tmux can also act sort-of like a tiling window manager for your shells. So you could have a few shells open, and maybe split your screen 50/50 between two shells, or 50/25/25 or something.
It's a pretty useful program if you spend a lot of your day SSHed into external machines (or if you like to work locally in a full-screen terminal window). It's also got some esoteric keybindings and a steep learning curve and it messes around with your mouse, scrollback, and copy-paste.
iTerm2's tmux integration ignores the disconnect/reconnect stuff (although if you reconnect, your session will just "come back" in whatever state it was when you disconnected). The killer feature is that it takes tmux's window-manager functions and maps them onto tabs and windows in the GUI app. This basically makes it look and feel like you're running iTerm from whatever machine you're logged into over SSH, except that what actually happens under the hood is a bunch of tmux magic.
In short, it's a terminal multiplexer (hence the name, tmux) that allows you to run multiple terminals within one (as opposed to opening a new window for each interactive shell you want to use). I spend 90% of my time as a developer either inside tmux or a web browser, so it wouldn't be a stretch to say that I find it quite useful.
The functionality I use the most in tmux is:
- attaching and detaching from a tmux session (e.g., for running machine learning jobs over SSH)
- having multiple terminals open inside of one
- scripting the setup of windows, panes, etc. for different projects I'm working on
I basically use vim and tmux as an IDE: my usual setup consists of one large pane consisting of vim and code, while two other panes are available for running git commands, starting servers, etc. Within one tmux session I separate different projects (e.g., frontend and backend) into tmux windows, and it's very easy to switch between panes, windows and sessions using keyboard shortcuts.
If you didn't miss it until now, it's likely you won't need in much in the future, either. Three main features and their value as I judge them:
* Detach/reattach sessions. This is useful; I run a always connected IRC client on my home machine in a detached session, then reattach to it on the go or from work. Tip: http://enwp.org/Byobu_(software) / http://byobu.co has a vastly better out-of-the-box experience than plain tmux.
* Split screens. I never use it. My GUI terminal emulator software already can do that, but plain tabs or the window manager's features have always been sufficient.
* Connection multiplexing. SSH already does that for me, see `ControlMaster` and `ControlPath` in `man 5 ssh_config`.
Tmux is kind of like nohup, but for the whole shell. If you SSH into a terminal and start tmux, it'll give you a shell that survives disconnect/reconnect.
Tmux can also act sort-of like a tiling window manager for your shells. So you could have a few shells open, and maybe split your screen 50/50 between two shells, or 50/25/25 or something.
It's a pretty useful program if you spend a lot of your day SSHed into external machines (or if you like to work locally in a full-screen terminal window). It's also got some esoteric keybindings and a steep learning curve and it messes around with your mouse, scrollback, and copy-paste.
iTerm2's tmux integration ignores the disconnect/reconnect stuff (although if you reconnect, your session will just "come back" in whatever state it was when you disconnected). The killer feature is that it takes tmux's window-manager functions and maps them onto tabs and windows in the GUI app. This basically makes it look and feel like you're running iTerm from whatever machine you're logged into over SSH, except that what actually happens under the hood is a bunch of tmux magic.