17
8
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
1For the solution that starts with
backtick
: (1.) isbacktick
a 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.screenrc
syntax requires one line for thehardstatus
command? (3.) how would I modify your command to allow appending some text after the session name? – Trevor Boyd Smith – 2015-11-12T21:17:39.073@TrevorBoydSmith:
backtick
is ascreen
command. 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 usesed
orawk
instead ofgrep
to do whatgrep
is doing in my example and also append some extra text. – Paused until further notice. – 2015-11-12T22:27:14.157When I said "two line" let me restate what I meant, I don't want a two line display for hardstatus. I was confused by the
– Trevor Boyd Smith – 2015-11-13T14:33:58.480%`
and thebacktick
being on separate lines... they didn't look related but now that I read the documentation forbacktick
I see that the two are related/necessary/valid-syntax (albeit rather strange syntax IMO).