Frank Blendinger, Wed 2009-03-11 01:53 CET:
> Hi,
> 
> I want to see the name of the session in my caption. As there is no
> predefined string escape, I tried this:
> 
>     backtick 1 0 0 echo $STY
>     caption always "...%1`..."
> 
> but the environment variable STY is not set when the backtick command is
> executed.
> 
> How could I get the session name otherwise?

Since $STY is not set yet when screen sources .screenrc, you can use
this trick in your .screenrc:

screen
screen $SHELL -c 'screen -X caption always "$STY"'

I.e. send a screen command to the first window.

HTH
Stony



_______________________________________________
screen-users mailing list
screen-users@gnu.org
http://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to