Exporting env vars to other xterms

Hi

I'm trying to set-up ssh-agent which involves setting up some environment vars, but I've encountered a problem.

If I 'export foo="bar"' in a KDE Konsole, $foo is not made available in any other Konsoles, new or existing. Which means that when I run ssh-agent, which sets various vars, I can only use it in the original Konsole session (or laboriously redefine the vars in each new Konsole by hand).

I've googled but can't find a reference to the problem, let alone a solution!

Seems so simple - Any ideas?

sim
 
You need to go about this another way. Environment vars can only be exported to child processes. You need to export those vars higher up in the process chain, eg. before your window manager starts.

What I do is let ssh-agent start my WM. In my ~/.xsession:

Code:
ssh-agent xfce4-session
 
  • Thanks
Reactions: sim
aragon said:
You need to go about this another way. Environment vars can only be exported to child processes. You need to export those vars higher up in the process chain, eg. before your window manager starts.

What I do is let ssh-agent start my WM. In my ~/.xsession:

Code:
ssh-agent xfce4-session

Your suggestion put me on the right track - I ended up using this solution: http://mah.everybody.org/docs/ssh-agent-startup (see last section).

Thanks!

sim
 
Back
Top