Can you please ELI5 tmux?

https://lemmy.ml/post/1931366

Can you please ELI5 tmux? - Lemmy

I am fairly familiar with Linux, I’ve been using different distros for some years now and have done some config editing here and there. I am also a web developer and use the terminal quite a lot and so I always stumble on people’s recommendation to use tmux and how good it is, but I never really understood what it does and, in layman’s terms, how can it be useful and for what use cases. Can you guys please enlight me a bit on this? Thank you.

Well, not knowing what other explanations you've read but don't understand/grasp makes it a bit difficult to narrow down specifics, though to start from the beginning, tmux is a terminal multiplexer, what that means is that it will allow multiple sessions running concurrently under the same virtual terminal. It provides keyboard shortcuts to switch between them, or split them and display them concurrently.

The biggest use case for me however (though I use an older one called screen out of hard to shake habits) is the ability to detach and attach at will, so that any disconnected remote sessions won't kill whatever I happen to be working on. Alternatively, I can have running sessions locally on my current machine and then I can go elsewhere and remote in and resume from where I've left off.

A somewhat frowned upon use case is to use it to run "background" processes on a remote server - like a development web service that you just can't be bothered to properly package/daemonize - just open screen or tmux, start it, and detach the session and it should stay running barring any other problems.

A somewhat frowned upon use case is to use it to run “background” processes on a remote server in most cases screen/tmux is an overkill, I prefer using setsid for quick and dirty scripts, it just gives a process separate id, detaching it from parent terminal. Or nohup when I need to check the output.

I use screen still too, partly because it’s generally installed on everything already, like vim. I hardly ever use anything but a maximised (i.e. full-terminal) screen at once, so it doesn’t sound like I’m missing much from tmux.

De/reattaching’s extremely useful and another thing I really like in screen is being able to scroll and search the scrollbuffer.

If I was ready for an upgrade, I’d probably go for zellij.

About Zellij

Zellij is a terminal workspace. It has the base functionality of a terminal multiplexer (similar to tmux or screen) but includes many built-in features that would allow users to extend it and create their own personalized environment. Split the terminal into different panes and tabs Like other multiplexers, Zellij allows users to split their terminal into different panes and tabs: Layout Engine Zellij includes a layout engine, allowing users to define a map of panes in a configuration file and load it when they start the app.

I use screen as well. It is significantly faster than tmux.