6 ms·
For anyone who spends their day (or most of some days) in a terminal connected to a remote server, I can't recommend using GNU Screen enough (brief tutorial: ht
by scott_s 15y ago
For anyone who spends their day (or most of some days) in a terminal connected to a remote server, I can't recommend using GNU Screen enough (brief tutorial: http://www.kuro5hin.org/story/2004/3/9/16838/14935 http://www.kuro5hin.org/story/2004/3/9/16838/14935).
I've worked almost exclusively on remote servers, using the command line and vim, for about eight years now. It's only been in the past year that I started using Screen, and I feel stupid for not using it sooner.
- pyrhho 15y agoSince we're pimping terminal multiplexers, I quite enjoy tmux (http://tmux.sourceforge.net/ http://tmux.sourceforge.net/). I used to use screen, but found tmux to be faster, smoother, and have more logical key-combos (your mileage may vary).
- scott_s 15y agoI saw two people below who say they prefer tmux over Screen, so I just looked it up. What I care about most is persistence; I use multiple terminal sessions if I want to have multiple windows. Did you find any difference for that feature?
- scottschulthess 15y agoCan you explain your question better? I don't understand it enough to take a shot at an answer
- scott_s 15y agoThe only feature I care about is persistence. Is there a difference between Screen and tmux regarding persistence?
- djcapelis 15y agoNo.
- nzmsv 15y agoIf you only need persistence, look into dtach. That's all it does. Both screen and tmux offer multiple persistent sessions, the difference is the command syntax. Back when I was deciding on a terminal multiplexer I picked tmux over screen because session sharing seemed to be done in a more sane way. But then again, had I used screen for any length of time I'm sure I'd have gotten used to it.
- scott_s 15y agoLooking briefly at dtach, screen's handling of named sessions seems to be marginally better, so I'll stick with it.
- froseph 15y agoI've been using screen for years, and just switched to tmux since so many people have been raving about it. The reasons I switched were: 1/ Configs for status prompt were easier to grok 2/ Actively maintained. I used to use vertical split all the time and tmux had that where as gnu screen required hack patches. If you only want persistence, screen, tmux, dtach do pretty much the same thing.
- guyht 15y agoI used to use screen, but then moved on to tmux. Main reasons for my move were * Tmux handles split screens better (had horrible lag in screen, its a known bug) * Panel and window navigation is easier in Tmux
- hack_edu 15y agoAnd anyone who uses GNU screen ought to know about Byobu, which makes screen a bit more visual and easy to navigate. Especially perfect for headless instances. Not wanting to leave it is why I've not spent much time with tmux. Is there something similar for it?
- ynniv 15y agoAh! This is excellent! byobu appears to make screen configuration (particularly status lines) easier, while otherwise keeping out of the way. I won't be switching to F-key controls right away (I have a soft spot for the iTunes and volume bindings on Mac keyboards), but since byobu only speaks when spoken to, it is a welcome addition to my workspace!
- hack_edu 15y agoGreat! You can switch between screens using Control-A and the screen number. I hadn't even known about the function keys until now.
- ynniv 15y agoAlso $ESCAPE-space and $ESCAPE-backspace move sequentially among screens. control-a is screen's default $ESCAPE, but it's a poor choice given the use of control-a for beginning-of-line. I'm pretty happy with backtick (`) with no modifier now that I'm using $(...) for bash sub commands. You can't use byobu to change $ESCAPE to a sequence that doesn't use control, but it is easily set via "escape ``" in ~/.screenrc.
- andrewsardone 15y agoHere's a very quick crash course in GNU screen, getting you up to speed with the core components: https://github.com/cdzombak/crashcourse/blob/master/courses/screen.md https://github.com/cdzombak/crashcourse/blob/master/courses/...
- srik 15y agoQuick, brief and to the point. I like the style. If only it existed when I was learning screen, much better than the man pages for sure.
- srik 15y agoScreen is great. Though not it's fault, the only downside is that it cant persist through a machine restart.
- moconnor 15y agoI've never restarted my Linode ;-)
- dspillett 15y agoWhat about when a kernel update is due? Is something fancy like live patches (via http://en.wikipedia.org/wiki/Ksplice http://en.wikipedia.org/wiki/Ksplice or the like) happening or are you simply skipping security updates?
- moconnor 15y agoWell, I've only had it for a month. No, I'm not going to try to do anything fancy, the machine will go down for kernel updates just like any other.
- scott_s 15y agoThis is true, but: 11:12:52 up 44 days, 54 min, 63 users The machines I connect to are restarted rarely. I expect this particular machine to be up until Christmass time, at which point there will probably be some scheduled maintenance.
- bmelton 15y agoCan you say the same about your workstation? Can you say the same about your power grid? Can you say the same about your internet connection? Screen/tmux/dtach are so trivial to implement and use and make the connection much more bulletproof that if you foresee there ever being a possibility that you might disconnect and lose work, then you should probably be using one of them.
- 15y ago
- vectorpush 15y agoMy only very minor issue with screen is that it ignores window resizing escape codes. I have my .vimrc setup to resize on start/exit and screen doesn't care at all. I am totally vain I know.
- kokey 15y agoI've been using screen for over 16 years now. The only time I have code on my local machine is if I'm writing code to interface with hardware directly or developing for a console like the GP2X. Otherwise, my computer has mostly been a terminal to servers out there which I never physically get to see. I can switch between machines at home or at work and resume my screen session. In other words, it seems like I've been working in 'the cloud' for the past 16 years and it can appear to me that everyone else is slowly catching up to this nifty idea. The reality is that trends swing between thin and thick clients, centralization and decentralization. They are competing forces.
- zyfo 15y agoWhat about lag? I find sometimes on bad connections that tmux lags quite a bit (in Sweden, sever in UK). How do you deal with this? Surely packet loss and latency must've been a bigger problem a decade ago.
- kokey 15y agoLag, well I used to dial up from South Africa, to places in Europe or the US. The call was normally blue boxed over analog satellite lines, one or two hops to a geostationary satellite and back. I used to bring my speed down to 7200bps since it was the most stable. I tolerated that because I had no other choice, and you learn to type very accurate that way and pause at certain moments because the next command will be a bad idea if you get the previous command wrong. (e.g. cd /tmp/bar ; rm -rf foo ) Things have improved for me a lot since. It does help that I live in the UK now. I believe nowadays within Europe something must be wrong to notice the difference (especially with SSH compression and screen), and the latency between the UK and the US has improved so much recently that I've forgotten that most of the servers I've been working on the past year is on the other side of the Atlantic.
- sliverstorm 15y agoIf you require a gui, NX is indispensable.
- tripzilch 15y agoSince I had to look it up, to save others my effort: http://en.wikipedia.org/wiki/NX_technology http://en.wikipedia.org/wiki/NX_technology Looks pretty good. Bookmarked for whenever I need a good remote desktop.
- sliverstorm 15y agoIt is the most useable remote desktop system I have ever used. On a medium-speed link it is nearly seamless, which is a lot more than I can say for RDP, VNC et al on a direct LAN connection.
- kiranryali 15y agobyobu is fantastic as well