Avoid getenv() - dlsym() - calloc() - getenv() race
[screenenv.git] / README
blobb2cde2fe4aeac9445205af8b3620e9079c340065
1 screenenv-0.1 - Physical session environment accessible within screen
4 screenenv is a simple gadget to be used together with GNU Screen.
5 It will make applications running within screen see some environment
6 variables from the currently active screen client, not based on the
7 first attached screen client. This enables applications to use
8 the appropriate X display, SSH agent forwarding settings, etc.
10 Consider the situation: You have a screen session, originally started
11 on a local desktop; later, you attach it over ssh as well (with X
12 forwarding enabled). Now you do your happy mutt mail-reading, but
13 stumble over an image attachment. If you try to open it over ssh,
14 the picture will show up on your local display, not the ssh-forwarded
15 one.
17 But if you preload screenenv, applications trying to use X will
18 automatically choose the appropriate $DISPLAY based on the session
19 with the least idle time!
22 Installation instructions:
24         $ make # ;-)
26 Now, you should test if it is not totally broken, by testing e.g.
27 the above scenario within your screen session, running:
29         $ LD_PRELOAD=./screenenv.so display picture.png
31 This should work properly when run from the either attached screen.
32 You do not need to restart your screens or anything else. Do not
33 forget to ssh in using `ssh -X`.
35 Once you are reasonably confident with screenenv, you can make
36 all your executables use it by default by adding it (with full path)
37 to /etc/ld.so.preload. Applications running outside of screen will
38 continue to work fine. But be very careful when editing the file!
39 If it ends up containing invalid entries, your entire system may
40 become unusable; in emergency, `>/etc/ld.so.preload` within already
41 running shell should resolve the situation.
43 Have fun! And give me feedback at pasky@suse.cz.
46 Thanks thement for inspiration for the implementation.