0

I have just started using the hardstatus capability of GNU screen to get a status bar of at the bottom of my terminal. This is particularly useful when running nested screen processes as I get nested status bars which makes it clear how many times I have to press the command key to access a particular screen instance.

For example

tom@stilton:~% ls
a/ b/ c/ d
.
.
.
[stilton] [1* zsh  2$ mutt]
[cheddar] [1$ emacs 2* ssh]

* indicates which window is selected. This makes it clear that I am running screen on cheddar with two windows: emacs and ssh. In the latter I am running another screen session on stilton with two windows: zsh and mutt. To switch to mutt on stilton I need to do "C-a a 2".

This is very useful, but could be more useful.

My question: when the command key is pressed, can I indicate this in the status bar, for example by highlighting it?

This would mean that when "C-a" is pressed the [cheddar] status bar would be highlighted and I would know that commands would be sent to that screen instance. If I were to further press "a" to send a literal "C-a" to the nested screen process the [cheddar] status bar would lose its highlight and the [stilton] status bar would highlight.

This would decrease the cognitive load of using screen considerably!

Tom Ellis
  • 9,224
  • 1
  • 29
  • 54

1 Answers1

2

In git version, that feature was committed recently.

http://git.savannah.gnu.org/cgit/screen.git/commit/?id=db59704c1297c056cec0cc9305ae92e44a15bf33

This new string escape character %E can be used in the same manner as %F both caption and hardstatus.

In the following examples, when you press C-a, then foreground color of hostname %H changes to yellow

hardstatus alwayslastline '%m/%d %02c:%s %?%E%{= .Y}%:%{= .g}%?%H%{-} %L=%-w%45L>%{= g.}%n %t%{-}%+w %-17<%=%{= .y}(%l)'
yoshikaw
  • 136
  • 2