2 Answers
2

UPDATE: seems to be a bug with echo built into bash. Solution should be either use of /bin/echo or \0134. Try:

$ echo -e "\134 = \0134"
\134 = \
$ /bin/echo -e "\134 = \0134"
\ = \

This is the escape sequence that screen needs to identify which command is being run, and replace the title of your current window.

Then, on your .screenrc file, make sure the following lines exist:

shelltitle '> |something:'
hardstatus alwayslastline

The pattern search|name tells screen to search your end-of-prompt for some string (in this case, '> '). The name part, specifies the default shell name for the window. So, when you have nothing but the shell running, you'll see something like:

Almost... Your hint for \0134 or /bin/echo works with my above example, so I can have the caption updated with the string between two escape sequences without having my prompt messed. But I can't still make your example working. My prompt under screen is ${debian_chroot:+($debian_chroot)}\u@\h:\w\$ so I'm using shelltitle '$ |bash', is that right?
–
FabioFeb 12 '11 at 14:07

thanks, I'm having it work without the hardstatus ... line in .screenrc, I'm using caption always ..., not a screen guru though.
–
ryenusJul 4 '14 at 1:41