Been searching around for this one without much luck. What I want is something that tells me if I've pressed C-a in Screen. Vim displays "-- INSERT --" when insert mode is selected. Something like that would be handy to have in Screen's hardstatus. Anybody got some suggestions on how to do this (if it's really possible)?
2 Answers
That isn't possible in the current version of screen.
That said, I usually just hit C-a (again) to check if I'm uncertain... If nothing happens, you know it's ready for a command; if it changes window (or tells you there are no other windows) then you know you are "clear".
For a long time I got often baffled in Screen just because I didn't know if escape key was pressed. It was so until Ben Love came up with a patch which adds a new hardstatus escape for escape key ( bug #27713 ). Download this patch and apply it to recent Screen sources. This patch adds a new hardstatus escape %E. Simplest possible usage:
# invert colors when escape key active
# %{+s} is activated when %E is true
hardstatus string %?%E%{+s}%?%w
hardstatus alwayslastline