You are not logged in.
Pages: 1
Hi,
Is there a way show on that status line environment variables from each screen shell?
Thks
Offline
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
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
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
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
This isn't a support thread.
Splitting...
Offline
Pages: 1