I run multiple screen sessions each created with 'screen -S name' and I would like to be able to display in the status bar the name I used to create the current screen session.
However, I cannot seem to accomplish this. Any ideas?
Type the following three keystrokes / commands one after the other: Ctrl-A then : then sessionname (Ctrl-A should be substituted with whatever you have set for the screen control keystroke, if you have changed it from the default of Ctrl-A.) You will then see output similar to: This session is named '31438.
You might want to check answers here: How do I display the current "session" name or "sockname" of a screen session in the status bar? In short the $STY environment variable is what you are looking for. The session name without ID can be obtained by ${STY#*.} .
Ctrl + A , : followed by sessionname name (1). Within a single screen session, you can also name each window. Do this by typing Ctrl + A , A then the name you want. You can view an interactive list of named windows by typing Ctrl + A , " , and select the one you want to switch to from that list.
On the command prompt, type screen . Run the desired program. Use the key sequence Ctrl-a + Ctrl-d to detach from the screen session. Reattach to the screen session by typing screen -r .
The easiest way to display the sessionname is
C-a : sessionname
(without specifying a name after sessionname
)
See the "CUSTOMIZATION" section in man screen
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With