how to include screen's session name in hardstatus?

Posted by fungusakafungus on Super User See other posts from Super User or by fungusakafungus
Published on 2010-11-18T17:11:01Z Indexed on 2011/01/07 3:55 UTC
Read the original article Hit count: 214

Filed under:
|

I use different screen sessions for different projects. Starting screen like screen -S project1. Now, I'd like to mention 'project1' in hardstatus line.

Session name can be obtained from environment variable STY: STY=13539.project1.
But how to get this into screen? I've tried backtick command and %` in hardstatus, but I can't seem to get it right.

What I did:

.screenrc:

hardstatus string '%H:%`'
backtick 0 30 30 echo $STY

no luck, empty %`.

backtick 0 30 30 sessionname

still no luck, sessionname: Not found

© Super User or respective owner

Related posts about screen

Related posts about gnu-screen