And no, don’t try to convince me that I should switch to tmux!

I have been using GNU Screen for ages. It’s a convenient and safe way to manage a remote Linux server. Screen enables me to have multiple ‘windows’ available in a terminal, running its processes independently. When I close screen (or when my ssh connection fails), the processes contained in the remote screen session keep running.
It’s how I can compile Chromium for instance – a package compilation can take up to 12 hours. I go to sleep and the next morning I reconnect the screen client to the remote socket of the still running screen daemon and continue as if I was never away.
Yes I know that tmux is supposed to be the successor of screen, but I simply don’t care.

I operate multiple Slackware servers in remote datacenters and run screen sessions over ssh connections. To avoid any confusion about the server that I am executing commands on, I have configured screen to show relevant information in the bottom line. This concept is called “hardstatus” in screen. Here’s an example showing the three active bash prompts, highlighting  that I am currently working in ‘Window 1‘, but it also shows the server’s hostname in green and the local time in blue.

Before typing anything, I first look at the green text to confirm that I am connecting to the right server.

Now, recently Slackware-current upgraded from GNU screen 4 to version 5 and with that, an old compatibility syntax was removed – a syntax that made it easy to define the colors in that status line. But the info page which describes the syntax is probably written for even more stubborn people than me.

It took me a while to get the look and feel of my screen 4.x status line reproduced in screen 5. In fact, I fixed the hardstatus definition only today (after 4 months of barely tolerating the junked colors and finally having enough of it), and I want to share it with you.

This is what defines the status line in my Linux computers with screen 4:

# Tabbed colored hardstatus line:
hardstatus alwayslastline
hardstatus string '%{= Kd} %{= Kd}%-w%{= Kr}[%{= KW}%n %t%{= Kr}]%{= Kd}%+w %-= %{KG} %H%{KW}|%{KY}%101`%{KW}|%D %M %d %Y%{= Kc} %c%{-}'

And this is how the definition had to change for screen 5 in order to show the exact same status line:

# Tabbed colored hardstatus line:
truecolor on
hardstatus off
hardstatus alwayslastline '%{= .;#999999} %{= .;#999999}%-w%{= #ff0000;#999999}[%{= #ffffff;#999999}%n %t%{= #ff0000;#999999}]%{= .;#999999}%+w %-= %{#00ff00;#999999} %H%{#ffffff;#999999}|%{#ffff00;#999999}%101`%{#ffffff;#999999}|%D %M %d %Y%{= #00ffff;#999999} %c%{-}'

In case you are curious about my full ~/.screenrc definition file, you can find it in liveslak: https://git.liveslak.org/liveslak/tree/make_slackware_live.sh?h=1.8.1.2#n2053 – I still have to fix the hardstatus definition there though.

I hope that this helps some of you old guys.
In the comments section below, I won’t tolerate GNU haters, screen haters or other evangelists. Keep it civil.

Cheers, Eric