I frequently use ssh within screen to connect to a set of machines. It would be ideal to have the caption line show information about the server that I am ssh'd into (eg machinename, uptime and info from vmstat).
I noticed that the backtick
screen command only seems to run where screen is run, it doesn't execute on the remote machine. Is there an easy way to get backtick to run the command on whatever machine is currently ssh'd?
Screen recognizes a few extra control sequences that the terminal inside a window can send to affect Screen. Of particular interest to you will probably be the \ek and \e\ sequences. Anything in between those two will be used by Screen as the window title. You can then put the window title in your caption line.
http://www.gnu.org/software/screen/manual/screen.html#index-control-sequences-107
Give this a try:
I use that as my prompt on remote systems. It automatically sets the window title to be
user@name: path
. The escape sequence for Screen is at the end of that command.