4 ms·
To anyone to perhaps who has used both a lot: * Are there particular pros and cons to using screen or tmux? (I'm generally on macOS for work, but never really
by throw0101d 2y ago
To anyone to perhaps who has used both a lot:
* Are there particular pros and cons to using screen or tmux?
(I'm generally on macOS for work, but never really go into using iTerm2, so that integration isn't a big thing for me personally.)
Edit: I mean why use one over the other. I generally use something on the destination host I'm SSHing to in case the network goes sideways.
- kstrauser 2y agoIn that case, try Zellij. I gave it a shot the last time it made the rounds on HN and instantly loved it. Killer feature: mouse scrolling works out of the box.
- sundarurfriend 2y agoI loved Zellij, it was the first time a terminal multiplexer felt like it added significant value without significant work from me. The only problem is that projects dealing with network stuff require aging just the way wines do. Networks are unreliable and can get into a thousand different states that are a combination of local connection issues, remote issues, input problems, etc etc. I found (when I tried it a year or two ago) that Zellij could handle a decent amount of such weird states, but not all of them. There was noticeably more "stuck" states it could get into. It was a pleasure to use in every other way, and maybe this has become much less of a problem in the intervening time. I'm pretty sure that Zellij is going to be my one true term mux for the future, just not sure that future has started yet.
- kstrauser 2y agoI've used tmux for ages and would go back if zellij ceased to exist, but I found zellij so much more discoverable. Want to do something new? Chances are there's a menu for it.
- nolist_policy 2y agoScreen can connect to serial ports. screen /dev/ttyUSB0 9600
- thiht 2y agoWhat does it do exactly?
- d4rti 2y agoIt's been a while but I used this with a USB to serial and a console cable for accessing Cisco switches/routers console.
- pak9rabid 2y agoIt functions like a lightweight version of minicom (which is a terminal program), which when connected to the console port of many network appliance hardware devices (like switches, routers, access points, etc) allows local access to the device (much like having a monitor/keyboard/mouse connected to a computer) without having to rely on a network connection.
- pwg 2y ago> Are there particular pros and cont to using screen or tmux If you mean vs. not using screen or tmux, the pros to using (among many) are: 1) you get plural terminals in one "window" (xterm, remote ssh session, etc.) that you can switch between with hot-keys. This has a larger advantage for remote ssh sessions, where one ssh connection can be used for plural remote terminals, than it does locally where you could simply launch a second xterm. 2) you gain the ability to 'disconnect' from the screen session (I presume tmux offers a similar feature). This works just like 'disconnect' from a RDP session. All your remote terminals remain active, open, and waiting. When you next ssh in, you simply 'reconnect' and everything is there just as you left it when you disconnected. This helps for both flaky connections where the link drops at times as well as the "done for the day" "disconnect". 3) for screen, there is a screen built in 'copy and paste' controlled by the screen hotkeys, so if you are in a situation where you have no local copy/paste (unlikely in 2024, much more likely back in the days of VT100's) you can still select and copy portions of the screen to a 'clipboard' for pasting into somewhere else. I don't know if tmux offers something similar. 4) screen also offers 'scrollback buffering' (it will retain the last X lines that scroll off the top of your viewport) and has a feature to let you "look back" at what just scrolled out of view. This is less useful in 2024 with xterms/urxvt's offering the same feature locally, but for a remote ssh connect this does give you 'scrollback' that is specific to each screen terminal you have open instead of all mixed up in the local viewer. There's more advantages, but those are the big ones, and the 'disconnect/reconnect' one is huge if you use the terminal a lot and also often connect via ssh from remote locations.
- filloutform 2y agotmux does all that
- Izkata 2y agoOne advantage of knowing screen, it's likely already installed on whatever remote machine you're connecting to.
- throw0101d 2y agoIIRC: RHEL9 no longer has screen (EPEL-only), and only has tmux.
- WhatIsDukkha 2y agoTmux allows you to start multiple windows and send commands to them. An example from man tmux - " refresh-client -t/dev/ttyp2 rename-session -tfirst newname set-option -wt:0 monitor-activity on new-window ; split-window -d bind-key R source-file ~/.tmux.conf \; \ display-message "source-file done" " Screen has no equivalent besides manually using the keybinds. I believe tmux has some better mechanics around the attach/detach but it eludes me atm what was better. Basically what made me switch in the first place from screen to tmux was wanting a split window watch compile and a logfile to run automatically with one command. Hard with screen and easy with tmux.
- rramadass 2y agoLong ago i decided to train myself on a lightweight development environment available on all platforms so i can carry it around easily in my head. I came up with GNU Screen + dvtm tiling window manager(as needed within each screen window) + Vim (with Cscope + GNU Global/Ctags). I generally leave this running on a central server/my local desktop/laptop, connect from anywhere anytime (detach/reattach) and continue working. From this central screen session i can connect to various other machines (including embedded devices via serial/USB/Network) allocating one screen window running dvtm (allows me to run multiple shell sessions) to each machine. This keeps everything clean and nicely organized in my head thus allowing me to carry it to any needed platform.