8 ms·
Why You Should Try tmux Instead of screen
- beagle3 10y agobyobu it can use either as a backend, and makes them better IMHO. YMMV.
- jonathan_s 10y agoAlso check out pymux: https://github.com/jonathanslenders/pymux https://github.com/jonathanslenders/pymux
- Perixoog 10y ago>When several clients are attached to the same session, each client can watch a different window. When clients are watching different windows, every client uses the full terminal size. Nice.
- luchs 10y agoTmux supports this as well, just use "tmux new-session -t xy" instead of "tmux attach-session -t xy".
- rcarmo 10y agoI've been using tmux for years now, and the last time I had to use screen (because it was the only thing pre-installed on a server) it felt like going back to the Dark Ages. Only gripe I have with it is that copy-paste can be fiddly, but that's terminals for you.
- ZeWaren 10y agoDon't forget neercs! It has the most useful feature of all: a rotating 3D cube.
- fennecfoxen 10y agoSomehow that seems even less useful than sl(1).
- j0rd 10y agoPick one and use it. I personally use screen, because it's what I learnt years & years ago. I also like that sometimes it's there by default when I login to a new server. ...but most linux "power users" prefer tmux.
- andrewfromx 10y agoexactly what I thought. Screen is there by default always and tmux would have to be installed sometimes. So maybe I should pick screen even though tmux is more modern and better? Tough choice really. I could see myself on some server someday without the time/option to install tmux and trying to learn screen in 5 mins.
- weitzj 10y agoI use vim to be prepared for a new server, but do not stay with screen to be prepared. I only once had a need (easy copy paste in terminal) to get tmux running on a server with no SSH, so I installed it. For all other machines, which do not have tmux installed I use my local machine and SSH/MOSH with my local tmux. If there is a need to have a long running command on a server, I use tmux to detach the session, fallback to screen for detaching, fallback to SSH nohub
- j0rd 10y agocheatmode is have a local statically compiled version of tmux ready to godmode servers you can SCP files to (all of em, if you've got ssh most likely) That's what I'd do, if a server doesn't have screen/vim and sysadmins are being a nuisance.
- weitzj 10y agoBrilliant!
- tanderson92 10y agoUnfortunately, the most recent tmux will not build statically.
- danmaz74 10y agoI'm not a heavy user, but I recently moved from screen to tmux. I initially chose screen because it is installed by default practically everywhere. But tmux is better, so, my take is this: choose tmux unless you'll need to work on servers where you can't get tmux installed.
- vitohuang 10y agoTmux - the config is so much easier to understand and shortcuts as well
- Morantron 10y agoI've been using tmux for a while. What I like most is the copy mode and its scriptability. Copy mode allows you to select and copy text using vi or emacs ( whatever you choose ) key bindings. This way, you can go completely mouse free in the terminal. This is also present in screen. Then scriptability: tmux exposes lots of commands so you can interact with it from a script. There are quite a few plugins out there. https://github.com/tmux-plugins/ https://github.com/tmux-plugins/ My personal favourites: - https://github.com/morantron/tmux-fingers/ https://github.com/morantron/tmux-fingers/ copy pasting using vimium-like hints, so you don't even have to enter copy mode ( this one I did it myself </shameless-plug> ) - https://github.com/tmuxinator/tmuxinator/ https://github.com/tmuxinator/tmuxinator/ predefined user sessions. Solves repetitively opening the same services/commands every time you start a coding session.
- jvandonsel 10y agoWhy would one prefer tmux or screen over multiple ssh sessions on a nice tabbed terminal program like iTerm2 ?
- jjnoakes 10y agoBecause if your network drops the connections, you can resume with tmux or screen, but not with vanilla ssh.
- jiqiren 10y agoThis is solved with mosh: https://mosh.mit.edu https://mosh.mit.edu Uses UDP/protobuffs so network connection can be lost/changed/etc.
- josteink 10y agoAnd since almost nobody uses mosh (and let's not talk about security implications of its implementation), problem is not really solved at all. You know, from a practical point of view.
- hythloday 10y agoNot sure if you're aware but iterm2 (v3) has tmux support so you can have the benefits of both.
- CJefferson 10y agoWhy would you prefer multiple ssh sessions over a single ssh session and tmux with iTerm2, which will let you keep the tabs (and when you make a new tab, automatically make it a remote connection). Look at 'tmux -CC', it's really great.
- CaptSpify 10y agoI use a jump-server, so I can ssh in, and connect to an existing tmux session. If I handled my terminals locally, I wouldn't be able to do that.
- josteink 10y agoI've used screen for years and years and because of the noise around tmux, I decided to try to give it a spin. In the end (rather quickly actually) I went back to screen. It's simple. It works. It's reliable, mature and stable. It has the "proper" keybindings which has been around for decades for this kind of software. Whatever tmux was supposed to provide of additional value I could not find. Edit: I see that this article (from 2010) says screen doesn't have a menu to select buffers. That's factually incorrect. That feature must have been there already before tmux was started?
- ris 10y agoYes, I've always found tmux to be a bit weird, especially its hijacking of mouse events which really throws me.
- dozzie 10y agoAdd `dvtm' inside `screen' session to your toolbelt. Splits your terminal into few other terminals you can arrange in several ways.
- oftenwrong 10y agoThere is another tool by the author of dvtm called abduco which provides session management features http://www.brain-dump.org/projects/abduco/ http://www.brain-dump.org/projects/abduco/
- GrinningFool 10y agoIs there additional functionality over native screen (or tmux) capabilities that appear to do the same thing?
- dozzie 10y agoI don't know, I've never bothered to read tmux' docs. As I hear from colleagues, there's none, apart from more friendly learning curve (dvtm doesn't try to handle sessions).
- zimbatm 10y agoOne thing I found tmux surprising for is how it inherits environment variables from the parent process and then loads the profile on top. This makes the resulting environment unusual. Instead it should either leave the environment as it, or create clean login shells.
- slgeorge 10y agoI thought the default was to create a login shell? See the "Start a non-login shell" section on the Arch Wiki[0]. I turn that off with the option mentioned there: that way it inherits from my current environment - I probably misunderstand what you mean by "inherit" versus "leave the environment as is". [0] https://wiki.archlinux.org/index.php/tmux https://wiki.archlinux.org/index.php/tmux
- pwelch 10y agoThere's also tmate which makes it easy to share a tmux session over ssh. Not sure if there is something similar for screen.
- bizarref00l 10y agomultiuser ? https://www.gnu.org/software/screen/manual/html_node/Multiuser-Session.html https://www.gnu.org/software/screen/manual/html_node/Multius...
- cm3 10y agoIf someone's looking for a third option: combine abduco with dvtm.
- alch- 10y agoWoah, tiling window management for the console! That is so awsesome. Thank you, good sir.
- dreamsofdragons 10y agoI started with screen, but moved to tmux around 5 years ago. For me, the sell was in custom layouts, and the no nonsense screen splitting. I usually work on several different project types, and have a scripted layout for each the of project types. This makes getting started in the morning instant. Tmux is great, but only after customizing it and making it your own, and this can take a fair bit of time. If you find yourself shelling into remote servers you don't control, or want to use it on Windows prior to Windows 10, then screen is probably a better choice. While tmux could be used on windows through cygwin, I never found it to be stable enough for day to day use.
- daviddavis 10y agoThe last time I used screen it didn't allow you to split windows vertically. This was 2-3 years ago. Is that still true?
- IE6 10y agoI usually use screen in a very vanilla way (i.e. logged into some rhel box I didn't build or configure) and in my experience you still cannot split vertically. x_x
- bizarref00l 10y agoctrl-a | is there from long more than 3 years, in the manual page for those willing to read it.
- IE6 10y agoUnfortunately for me most of the applications I have access to (and want to have installed) do not have custom patches including functionality like that. I'm left with C-a S as my only native option.
- amadeusz 10y agoSome distributions were using patched versions before, but from 17 Apr 2014 - screen 4.2.0 and further have it. Shortcut is: C - a |
- mivade 10y agoI was using tmux for a while after years of using screen. At least for my use case, the main thing I liked better about tmux was that windows (or whatever the proper term is) get their names updated based on the command running. In screen, I would have to manually change the name (maybe there is a way around this but I was always too lazy to find out). Why I switched back to screen: 1. It's more commonly installed. Not a big deal these days, but still. 2. It's really easy to resize a window to fit whatever terminal window I'm using: C-a F. As far as I could find, there is no way to do this with tmux.