Future Tech

GNU screen 5 proves it's still got game even after 37 years

Tan KW
Publish date: Tue, 03 Sep 2024, 11:50 PM
Tan KW
0 473,252
Future Tech

GNU screen is included in most Linux distros, but newer, fancier tools such as tmux often outshine it.

GNU screen 5.0.0 is the latest version of a tool that's been around since early 1987. This release has multiple tweaks to its (admittedly basic) user interface, much improved color handling, and better authentication support, including the ability to password-protect screen sessions.

This is only the second major release this century. Screen, which we will capitalize for clarity, is old enough that the history of its releases is obscure, but initial release notes were published in 1987. A possibly unofficial version 4 appeared around 2004, replaced by a more official 4.2.0 in 2014. The last point release, 4.9, was two years ago.

Screen is a terminal multiplexer, or a sort of call-forwarding service for the Unix command line. There are newer ones, which we'll get to, but Screen can do most of what they do.

For those who aren't habitual command line jockeys, we'll try to explain with a parallel. Imagine you are sitting at home on a laptop and you open a terminal window on your computer, then use that window to SSH into a different computer at the office and start some long, complicated process that will take hours. This doesn't have to be anything arcanely technical. Let's say you're writing a book and have several files open, one with the list of contents, another with a scratchpad, and the main draft document.

If you use a simple connection and accidentally close the window, you've lost that terminal session with three files open. Even if you saved all your documents and haven't lost any work, it will take some time to reopen them and find where you were. Screen puts a rerouting layer between your terminal window and the computers you're talking to. So, before you connect, you run Screen, then connect. If your laptop's battery suddenly runs out, no problem.

The next day, you retrieve the power lead, open Screen, and reconnect to yesterday's session with screen -r - and there are your files, exactly where you left them. Or you could switch to your desktop, open Screen and attach to that waiting session by name. Screen is capable enough that the different sessions can be on different computers, so a single terminal can manage multiple connections at once.

There are more modern terminal multiplexers around, such as tmux or the simpler dvtm, which only handles local sessions but works with the separate abduco to handle remote ones. A fancy modern equivalent, written in Rust, is Zellij. The most visible difference is that these all are tiling environments. Separate sessions appear side-by-side, or any other arrangement you prefer, on screen - all in text mode, without any graphical environment, including on the system console. However, Screen can do that as well. Pressing Ctrl+a, S splits the screen horizontally, or Ctrl+a, | splits it vertically.

As you might expect for a non-obvious program that's been around for decades, there are lots of tutorials for Screen around. It may take a while for them to pick up the new features in this release - and it will doubtless take most distros a while to incorporate version 5 too - but that doesn't reduce their helpfulness.

The biggest advantage of Screen over its younger rivals is its ubiquity. It runs on more or less every Unix-like OS out there, and has few dependencies. ®

 

https://www.theregister.com//2024/09/03/gnu_screen_5/

Discussions
Be the first to like this. Showing 0 of 0 comments

Post a Comment