Subject: sockname in hardstatus

From: Jaap Taal <[email-masked]>
Date: Thu, 18 Sep 2008 17:05:39 +0200

I'm looking on the net for a method to print the sockname/sessionname in 
the hardstatus. I've only found some messages from 2003 that say this 
would be nice to have => directed to wishlist.

I was trying the following workaround:

screenrc:
backtick 84 0 0 /home/jtaal/bin/screen_sockname
hardstatus string "%84` ..."

and the following bashscript in screen_sockname
#!/bin/sh
echo $STY

Executing the command inside a screen session works like a charm, but it 
doesn't show anything in the hardstatus.

If I echo another environment variable all goes well.

Is the backtick command executed with the original enviroment instead of 
the environment a shell inside screen would have?

_______________________________________________
screen-users mailing list
[email-masked]
http://lists.gnu.org/mailman/listinfo/screen-users

---

From: "Thomas Adam" <[email-masked]>
Date: Sun, 21 Sep 2008 17:15:40 +0100

Hello --

2008/9/18 Jaap Taal <[email-masked]>:
> Is the backtick command executed with the original enviroment instead of the
> environment a shell inside screen would have?

Yes.  And note that in the GIT version of screen, there's now a "%S"
identifier to do what you want.

-- Thomas Adam

---

From: Christian Mongeau <[email-masked]>
Date: Sun, 21 Sep 2008 18:16:27 +0200

On 2008-09-18, Jaap Taal wrote:
> the hardstatus.> I was trying the following workaround:
> [...]
> screenrc:

Changing your screen_sockname with:

#!/bin/sh
screen -ls|sed '/(Attached)/!d;s/(Attached)//;s/    //'

works (it deletes every line that doesn't have an "(Attached)",
then sustitutes that string with an empty one and removes the tab
(notice that the last pattern is a tab, i.e. s/TAB//, though it's
not really necessary)). I hope there's a better solution, but you
can adapt the previous one.

Regards.

chr

-- 
SDF Public Access UNIX System - http://sdf.lonestar.org