Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #94848

Re: [ONTOPIC] Screen 5.x and hardstatus lines

From jayjwa <jayjwa@atr2.ath.cx.invalid>
Newsgroups comp.os.linux.misc
Subject Re: [ONTOPIC] Screen 5.x and hardstatus lines
Date 2026-10-31 10:56 -0400
Organization Atr2 RG 2026
Message-ID <87y0bdapg2.fsf@atr2.ath.cx> (permalink)
References <87mrrwcw2x.fsf@atr2.ath.cx> <61kcrmxpke.ln2@Telcontar.valinor> <11c0rls$3s5m1$1@dont-email.me> <nklrdaFas32U1@mid.individual.net> <11c4g51$1025g$2@dont-email.me>

Show all headers | View raw


Nuno Silva <nunojsilva@invalid.invalid> writes:

>> Google AI: The screen command in Linux is a terminal multiplexer that
>> allows you to start a terminal session and then completely detach from
>> it. This leaves your processes running in the background, making it an
>> invaluable tool for executing long-running tasks over SSH without
>> worrying about network drops or accidental disconnections.
>>
>> Ie, similar to tmux. I gather you can customize the status line.
Right...it's the *doing* part I'm having an issue with. 

> Ask it what is a hard status line, to see if it gets that part right :-)
>>> /set nothink
Set 'nothink' mode.
>>> What is a GNU Screen hardstatus line?
A **GNU `screen` hardstatus** line is a special configuration
string defined in the `.screenrc` file (or passed via command-line
options) that controls the content displayed on the very last
line of every visible screen window.


qwen3.5:9b ends up in the dirt and never did spit out a hardstatus
line. This is over 100+ lines but I'll give you a few highlights. It
does notice the syntax change from 4 -> 5 but then says you don't need
to change anything (this obviously is wrong).

ollama run qwen3.5:9b                               
>>> """Convert this GNU Screen 4 hardstatus .screenrc line into GNU Screen 5 syntax:
... hardstatus alwaysfirstline '%{= G}[ %{G}%H %{g}][%= %{= w}%?%-Lw%?%{= R}%n*%f %
... t%?%{= R}(%u)%?%{= w}%+Lw%?%= %{= g}][ %{y}Load: %l %{g}][%{B}%Y-%m-%d %{W}%c:%s
...  %{g}]
... """


* Is there an actual syntax change?

* Ah! In GNU Screen 5.0, there was a significant update regarding
    **color definitions**.  They moved from using color names like `G`,
    `R` to expecting palette indices or terminfo capabilities if colors
    aren't pre-defined. But usually, you define them in `.screenrc`
    first.

* Actually, the most common answer to this question (often found in
Linux forums) is that **Screen 5 does not require syntax changes** for
`hardstatus` variables themselves (`%H`, `%n`), but the color attribute
flags like `%{= G}` are often simplified or standardized.

* **Correction:** I need to check if there were breaking changes
regarding the hardstatus line specifically between version 4 and 5.

* According to the GNU Screen ChangeLog: "hardstatus" support has been
present since early versions.

* However, in version 4.03-4.09 (and subsequent), syntax evolved.


Anyway, this is as close as I (the carbon-based life form) have been
able to get it. It still has some issues when multiple windows open
regarding color, but it's better than nothing, has color, shows the load
avg, and the time across the top. You need to "program" the backticks
first.

# Program "backtick" number one. Use it like so: %1`   
# backtick (id num) (seconds in lifespan) (autorefresh in seconds)
# (cmd) (args of command)
backtick 1 10 10 awk -F' ' '{print $1, $2, $3}' /proc/loadavg   # Find loadavg and print
backtick 2 10 10 date '+%a %h %d %H:%M:%S'                      # Another way to print date
hardstatus alwaysfirstline

hardstatus string '%{ 1;7}[ %{12;15}%H %{1;7}][% %{0;7}%?%-Lw%?%{13}(%{15}%n*%f%t%?(%u)%?%{5})%{1}] %52= %{2}%1` %72= %{1;0}[%{12;15}%D %M %d %c%{1;0}]'


-- 
PGP Key ID: 781C A3E2 C6ED 70A6 B356  7AF5 B510 542E D460 5CAE
       "The Internet should always be the Wild West!"

Back to comp.os.linux.misc | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[ONTOPIC] Screen 5.x and hardstatus lines jayjwa <jayjwa@atr2.ath.cx.invalid> - 2026-10-29 12:25 -0400
  Re: [ONTOPIC] Screen 5.x and hardstatus lines "Carlos E.R." <robin_listas@es.invalid> - 2026-10-29 20:39 +0100
    Re: [ONTOPIC] Screen 5.x and hardstatus lines Nuno Silva <nunojsilva@invalid.invalid> - 2026-10-30 01:25 +0000
      Re: [ONTOPIC] Screen 5.x and hardstatus lines "Carlos E. R." <robin_listas@es.invalid> - 2026-10-31 10:40 +0100
        Re: [ONTOPIC] Screen 5.x and hardstatus lines Nuno Silva <nunojsilva@invalid.invalid> - 2026-10-31 10:33 +0000
          Re: [ONTOPIC] Screen 5.x and hardstatus lines jayjwa <jayjwa@atr2.ath.cx.invalid> - 2026-10-31 10:56 -0400

csiph-web