Question

I am using the Linux Screen Utility to open more than 2 windows in my Putty terminal. Usually while running a screen session a

Ctrl+A Ctrl+W

gives us a list of window at the bottom of the screen.

I have two questions:

  • I wanted to know if there is a way to persistently keep this menu at the bottom of the screen.

  • How to give name to each window? Ideally when we execute

    screen -S screen_name

the screen_name should appear in the menu. I can only find

0.csh 1.csh 2.csh

in the menu. can this be changed to

0.debug_screen 1.editor 2.games
Was it helpful?

Solution

I have following lines in my .screenrc (found in Short Tip: GNU Screen with proper scroll, session management support):

caption always # activates window caption
caption string '%{= wk}[ %{k}%H %{k}][%= %{= wk}%?%-Lw%?%{r}(%{r}%n*%f%t%?(%u)%?%{r})%{k}%?%+Lw%?%?%= %{k}][%{b} %Y-%m-%d %{k}%c %{k}]'

A description of those cryptic identifiers can be found in the screen manpage, section STRING ESCAPES.

Btw.: Instead of caption you can also use hardstatus (which is displayed only once at the bottom line if you use split screens).

Windows can be renamed using C-a A (see again screen manpage, section Commands).

OTHER TIPS

I have the following line in my .screenrc which gives me a caption line at the bottom of the screen:

screen $SHELL -c 'screen -X caption always "%{= RW} $STY | %c:%s `date +%Z` | host:%H | load:%l | escape:CTRL-U "'

This gives me the following:

%{= RW}         <== White text on red background
$STY            <== Name of the screen session e.g. "4169.debug_screen"
%c:%s           <== The time in 24 hour format with seconds
`date +%Z`      <== The timezone the server is configured to
host:%H         <== The hostname of the server
load:%l         <== The current load averages of the server
escape:CTRL-U   <== A textual reminder that the screen escape key is set to CTRL-U (not CTRL-A)

I use different colour backgrounds on different machines so I remember if I'm on a production or development server - red for production to remind me to be even more careful than usual.

To get the list of screens running including names I just type 'screen -ls' (which I've aliased to 'scls').

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top