[texworks] Why is $PATH ignored?

Manuel Pégourié-Gonnard mpg at elzevir.fr
Thu Oct 2 20:36:07 CEST 2008


Jonathan Kew a écrit :
>> Why does texworks ignore the PATH environment variable? My TeX Live
>> binaries are in /usr/local/texlive/2008/bin/x86_64-linux, and this
>> directory is in my PATH, but texworks won't find it until I set it in
>> the preferences dialog.
> 
> How is that directory added to your PATH? 
> 
By putting the appropriate 'export PATH=...' statement in my ~/.xsession
(the script launching my window manager, of which all X11 program I can
lauche are childs). By the way, I also tried launching texworks from a
terminal.

> When TeXworks creates a
> subprocess, it doesn't inherit your interactive shell environment...

Oh. Why doesn't it? I've always managed my PATH settings assuming that
processes inherit their father's environment and never had problems
before. (By the way, both kile and texmaker, launched just the same way
as texworks, are able to find my tex binaries.)

Now, I tried my launching my X session another way, with my personal
environment loaded before the X server starts, and that way texworks can
find the binaries without problems. Could it be that texworks inherits
its environment from the X server itself, rather that from its father
process?

If so, I'd rather disagree on this way of doing things. For example, on
my university's application servers, the TeX component of the PATH is
set in each user's .xsession file [1] so probably texworks would "break"
there too. Also, I generally expect my personal environment (possibly
setting essential variables such as TEXMFHOME or cosmetic ones such as
LANG) to have some effect...

[1] I don't know whether it's a bad idea from the sysadmin or if this is
really necessary in order to take care of the various architectures of
the servers.

> I'd be more inclined to give them higher priority, I think; if the user
> explicitly asks TeXworks to use programs from a certain directory, it
> should do so. But first let's see if we can figure out the best way to
> get hold of your default paths, if appropriate.
> 
Oh, after some tests it seems like I don't understand at all how the
default list is built. Testing with the other configuration (loading the
environment before loading X), where my PATH is

/home/mpg/bin:/usr/local/texlive/2008/bin/x86_64-linux:/usr/local/bin:/usr/bin:/bin:/usr/games

I get only the three components

/usr/local/texlive/2008/bin/x86_64-linux
/usr/local/bin
/usr/bin

(no ~/bin, /bin, /usr/game). Is there yet another environment
inheritance artefact, or does texworks filter things in any way?

Manuel.



More information about the texworks mailing list