You are not logged in.

#1 2018-08-27 14:40:53

Catatau
Member
Registered: 2018-08-27
Posts: 3

Show screen status line

Hi,

Is there a way show on that status line environment variables from each screen shell?
Thks

Offline

#2 2018-08-27 15:15:24

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,541
Website

Re: Show screen status line

Not in any practical way.  The status line is outside of the scope of those variables, thus they can't generally be accessed.

In theory, one might be able to write a tool that looked up screen's pid, then every child processes pid, filtered for the relevant shell, then read from /proc/$PID/environ to pull out the variable of interest.  But this is very far from practical at best.

What variable do you want to show?  There may be better ways of acheiving the same goal.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

#3 2018-08-27 16:27:59

Catatau
Member
Registered: 2018-08-27
Posts: 3

Re: Show screen status line

Trilby wrote:

What variable do you want to show?  There may be better ways of acheiving the same goal.

A set some environment variables in each screen shell required to do my dev work! They have different paths in each screen shell. So instead of being echoing, I would like to put them on status line.

Anyway, thanks for your reply!

Offline

#4 2018-08-27 16:36:06

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,541
Website

Re: Show screen status line

You can set the window/tab title to incude the content of those variables, and this can be dispayed in the status line.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

#5 2018-08-27 19:15:14

Catatau
Member
Registered: 2018-08-27
Posts: 3

Re: Show screen status line

I tried something like this:
backtick 0 30 30 sh -c 'screen -ls | grep --color=no -o "$PPID[^[:space:]]*"; echo -n "  WORK=$(screen -S $(screen -ls | grep --color=no -o "$PPID[^[:space:]]*") -p0 -X echo -n $WORK)"'

Note, I am using csh. I don't know how to pass current -p X. It is not working! Any other ideas?
Thanks!

Offline

#6 2018-08-27 19:47:08

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Show screen status line

This isn't a support thread.

Splitting...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB