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
backtick: (1.) isbackticka bash builtin? a gnu-screen command? a binary executable? is there a man page? (2.) I know it works because I tried it but how do you get a two line command to execute when it seems like the gnu-screen.screenrcsyntax requires one line for thehardstatuscommand? (3.) how would I modify your command to allow appending some text after the session name? – Trevor Boyd Smith Nov 12 '15 at 21:17backtickis ascreencommand. Search for it in the man page forscreen. It might be best if you post a new question regarding the rest of what you're asking. I don't think hardstatus output can occupy two lines on-screen. You could usesedorawkinstead ofgrepto do whatgrepis doing in my example and also append some extra text. – Dennis Williamson Nov 12 '15 at 22:27%`and thebacktickbeing on separate lines... they didn't look related but now that I read the documentation forbacktickI see that the two are related/necessary/valid-syntax (albeit rather strange syntax IMO). – Trevor Boyd Smith Nov 13 '15 at 14:33