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


Groups > comp.os.linux.misc > #94774 > unrolled thread

[ONTOPIC] Screen 5.x and hardstatus lines

Started byjayjwa <jayjwa@atr2.ath.cx.invalid>
First post2026-10-29 12:25 -0400
Last post2026-10-31 10:56 -0400
Articles 6 — 4 participants

Back to article view | Back to comp.os.linux.misc


Contents

  [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

#94774 — [ONTOPIC] Screen 5.x and hardstatus lines

Fromjayjwa <jayjwa@atr2.ath.cx.invalid>
Date2026-10-29 12:25 -0400
Subject[ONTOPIC] Screen 5.x and hardstatus lines
Message-ID<87mrrwcw2x.fsf@atr2.ath.cx>
First, my apologies for posting about Linux in comp.os.linux.misc, but I
need a senior GNU Screen 5.x .screenrc config file programmer to sort
this mess out. When Screen 4.x jumped to Screen 5.x, it broke hardstatus
strings and I've not gotten them to work correctly since. Last night I
spent 60 minutes on this without results. We all love breaking config
file changes, don't we?

What I had before (the newsreader might wrap this) that I'd like to more
or less emulate in Screen 5-ese:
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}]'

This places, in color, the hostname in brackets to the left, each new
window with its title, in color, along the top, and then the load
average in brackets along with the date/time achored to the right. All
that breaks in 5 but I can still see the hostname and each new window
title. Just subbing the new color codes does not work. I already tried
that.

My best attempts thus far:
hardstatus string '%{ 1;0}[ %{12;15}%H %{1;0}][% %{ 0;7}%?%-Lw%?%{13}(%{15}%n*%f%t%?(%u)%?%{5})%{-b 7}%?%+Lw%?%?%= %{2}][%{6} %D %M %d %{2}%c %{2}]'

This has colors, but it goes off the rails on the right side when you
added more and more windows. I'm working off this:
https://www.pingle.org/2026/04/26/screen-5-status-color-changes

There's more descriptions in the 3990 line man page, but I'm already
reading one epic poem (Dante's Divine Comedy) and there's only so much
time in the day.

Here's another attempt that doesn't work, either:
hardstatus string '%{ 1;0}[ %{12;15}%H %{1;0}] (%X) %Y %M %d %c%a'

The Arch and Gentoo examples don't work; at this point I'd be happy with
something close to what I had. I don't really care what color(s) (I use
dark terminals, btw). I could use Tmux but at this point it's personal.

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

[toc] | [next] | [standalone]


#94780

From"Carlos E.R." <robin_listas@es.invalid>
Date2026-10-29 20:39 +0100
Message-ID<61kcrmxpke.ln2@Telcontar.valinor>
In reply to#94774
On 2026-10-29 17:25, jayjwa wrote:
> First, my apologies for posting about Linux in comp.os.linux.misc, but I
> need a senior GNU Screen 5.x .screenrc config file programmer to sort
> this mess out. When Screen 4.x jumped to Screen 5.x, it broke hardstatus
> strings and I've not gotten them to work correctly since. Last night I
> spent 60 minutes on this without results. We all love breaking config
> file changes, don't we?

Just posting so that you know that people read your post, even if we are 
engrossed in OT posts, but I'm not qualified to answer it. Sorry.

Not familiar with Screen; I use Tmux myself, but I don't touch the 
status line.

-- 
Cheers, Carlos.
ES🇪🇸, EU🇪🇺;

[toc] | [prev] | [next] | [standalone]


#94791

FromNuno Silva <nunojsilva@invalid.invalid>
Date2026-10-30 01:25 +0000
Message-ID<11c0rls$3s5m1$1@dont-email.me>
In reply to#94780
On 2026-10-29, Carlos E.R. wrote:

> On 2026-10-29 17:25, jayjwa wrote:
>> First, my apologies for posting about Linux in comp.os.linux.misc, but I
>> need a senior GNU Screen 5.x .screenrc config file programmer to sort
>> this mess out. When Screen 4.x jumped to Screen 5.x, it broke hardstatus
>> strings and I've not gotten them to work correctly since. Last night I
>> spent 60 minutes on this without results. We all love breaking config
>> file changes, don't we?
>
> Just posting so that you know that people read your post, even if we
> are engrossed in OT posts, but I'm not qualified to answer it. Sorry.
>
> Not familiar with Screen; I use Tmux myself, but I don't touch the
> status line.

(I was a bit confused as I expected this to be about a "hard" status
line, but seems to be a repurposing of the hard status line for
graphical terminal emulators?)

-- 
Nuno Silva

[toc] | [prev] | [next] | [standalone]


#94823

From"Carlos E. R." <robin_listas@es.invalid>
Date2026-10-31 10:40 +0100
Message-ID<nklrdaFas32U1@mid.individual.net>
In reply to#94791
On 2026-10-30 02:25, Nuno Silva wrote:
> On 2026-10-29, Carlos E.R. wrote:
> 
>> On 2026-10-29 17:25, jayjwa wrote:
>>> First, my apologies for posting about Linux in comp.os.linux.misc, but I
>>> need a senior GNU Screen 5.x .screenrc config file programmer to sort
>>> this mess out. When Screen 4.x jumped to Screen 5.x, it broke hardstatus
>>> strings and I've not gotten them to work correctly since. Last night I
>>> spent 60 minutes on this without results. We all love breaking config
>>> file changes, don't we?
>>
>> Just posting so that you know that people read your post, even if we
>> are engrossed in OT posts, but I'm not qualified to answer it. Sorry.
>>
>> Not familiar with Screen; I use Tmux myself, but I don't touch the
>> status line.
> 
> (I was a bit confused as I expected this to be about a "hard" status
> line, but seems to be a repurposing of the hard status line for
> graphical terminal emulators?)
> 

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.

-- 
Cheers,
        Carlos E.R.
        ES🇪🇸, EU🇪🇺.

[toc] | [prev] | [next] | [standalone]


#94829

FromNuno Silva <nunojsilva@invalid.invalid>
Date2026-10-31 10:33 +0000
Message-ID<11c4g51$1025g$2@dont-email.me>
In reply to#94823
On 2026-10-31, Carlos E. R. wrote:

> On 2026-10-30 02:25, Nuno Silva wrote:
>> On 2026-10-29, Carlos E.R. wrote:
>>
>>> On 2026-10-29 17:25, jayjwa wrote:
>>>> First, my apologies for posting about Linux in comp.os.linux.misc, but I
>>>> need a senior GNU Screen 5.x .screenrc config file programmer to sort
>>>> this mess out. When Screen 4.x jumped to Screen 5.x, it broke hardstatus
>>>> strings and I've not gotten them to work correctly since. Last night I
>>>> spent 60 minutes on this without results. We all love breaking config
>>>> file changes, don't we?
>>>
>>> Just posting so that you know that people read your post, even if we
>>> are engrossed in OT posts, but I'm not qualified to answer it. Sorry.
>>>
>>> Not familiar with Screen; I use Tmux myself, but I don't touch the
>>> status line.
>>
>> (I was a bit confused as I expected this to be about a "hard" status
>> line, but seems to be a repurposing of the hard status line for
>> graphical terminal emulators?)
>>
>
> 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.

Ask it what is a hard status line, to see if it gets that part right :-)

-- 
Nuno Silva

[toc] | [prev] | [next] | [standalone]


#94848

Fromjayjwa <jayjwa@atr2.ath.cx.invalid>
Date2026-10-31 10:56 -0400
Message-ID<87y0bdapg2.fsf@atr2.ath.cx>
In reply to#94829
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!"

[toc] | [prev] | [standalone]


Back to top | Article view | comp.os.linux.misc


csiph-web