A busy Screen session becomes harder to navigate when the only visible prompt belongs to the shell inside the current window. A compact status line keeps the host name, active window, and clock visible while long-running shells stay attached or detached in the background.
Screen uses hardstatus for a terminal status area or a reserved display line, and caption for labels on split regions. Format strings use percent escapes such as %H for the host name, %w for the window list, %c for the time, %3n for the window number, and %t for the window title.
Keep the format short enough for narrow SSH terminals, especially when %w expands to several windows. Screen can query the window labels that feed %w, but the status line itself is a display surface, so the final proof is the attached terminal with the reserved line visible.
Related: How to reload the Screen config
Related: How to rename a window in Screen
Related: How to attach to a Screen session
$ screen -ls
There is a screen on:
12345.work (Detached)
1 Socket in /run/screen/S-user.
The examples below target the session named work. Use the session name shown by screen -ls when yours is different.
$ vi ~/.screenrc
Most user sessions read ~/.screenrc unless $SCREENRC or screen -c points to another file.
hardstatus alwayslastline hardstatus string '%H | %w | %c' caption splitonly '%3n %t'
hardstatus alwayslastline reserves the last display line even when the terminal has its own hardware status feature. caption splitonly keeps captions limited to split-region sessions.
$ screen -S work -X source ~/.screenrc
Attached clients should update after the file is sourced. If Screen shows a screenrc warning, fix that line and source the file again before relying on the display.
Related: How to reload the Screen config
$ screen -S work -p 0 -X title logs
The -p 0 option preselects window 0 before sending the title command.
$ screen -S work -Q windows 0 logs
If the output still shows a generic title such as bash, rename the window before relying on the status line for navigation.
Related: How to rename a window in Screen
$ screen -r work screen-host | 0* logs | 7:20
The status line appears at the bottom of the attached terminal, not as normal shell output. The asterisk marks the selected window in the %w window list.
Related: How to attach to a Screen session