[texworks] Why is $PATH ignored?
mpg at elzevir.fr
Fri Oct 3 08:36:30 CEST 2008
Karl Berry a écrit :
> By putting the appropriate 'export PATH=...' statement in my ~/.xsession
> I would expect .xsession to be read when X is started, not when
> subprocesses of X applications are started.
I agree. But apparently texworks doens't get its environment from it
parent (the shell) but from some other process or some other "source of
environment" (at least in my case when using a X login manager, see below).
Is there a way to examine a process's environment while it's running? (I
guess it should be possible with gdb, but I almost never used it, so..)
> I have always put my PATH setting in ~/.bashrc (adjust for preferred
> shell), unconditionally, and source .bashrc from .bash_login. That way,
> it is set even with non-interactive ssh, etc.
Well, I'm using zsh, so .zshenv is sourced by every single shell (be it
login or not, interactive or not). And I source it from ~/.xession to be
sure I get it even when no shell is involved (eg lauching an app with a
kb shorcut in my window manager).
> I can't recall any real facts, but "in some cases" either the
> application or the system will clear PATH to something minimal when
> starting a subprocess.
But I guess texworks doesn't want to do this.
> I get only the three components
> Now that is puzzling. Maybe /etc/bashrc?
No, /usr/local/texlive/2008/bin/x86_64-linux isn't mentioned anywhere
except in my ~/zshenv.
> In any event, I don't know what TeXworks can do about this. It's just
> starting a subprocess in the normal way, I presume.
Hmm, so how comes it doesn't get the PATH from its parent process (eg
the shell when launched from a terminal).
PS: just noticed the following:
- when using my X login manager, "LC_ALL=C texworks" still gives the
interface in French, but
- loging in console and running startx from there, "LC_ALL=C texworks"
gives the english interface as expected.
So probably my X login manager is doing nasty things indeed. I'll
investigate this when I have a bit more time.
PPS: I still don't understand why apps like kile or texmaker can get the
right path and texworks doesn't. They must determine their environment
More information about the texworks