On Mon, Apr 26, 2021 at 09:26:19PM +0000, tetrahe...@danwin1210.me wrote: > I have some custom additions to my $PATH. They're defined in ~/.profile and > they are correctly loaded when I log in from a text console. > > When I log in to X (cwm) and open a terminal window, $PATH does not contain > the entries. > > I tried `chmod +x` on my .profile but that didn't help. > > Both the text console and the X terminal window are using ksh. > > When I call `/bin/ksh -l` then the resulting shell contains the correct > additions to $PATH. > > It looks like the custom $PATH is not being passed from the login shell on > downwards, since ~/.profile is only read by a login shell. > > ~/.kshrc is (according to ksh(1)) read by every spawning shell, but I don't > see any documentation or examples on the Internet where someone defined > their $PATH in ~/.kshrc ... > > What's the correct way to set $PATH and have it stick no matter where and > when the shell is spawned?
If you're using a display manager (xenodm or whatever), you've to include your .profile in your session login script (X equivalent of shell's ~/.profile concept), so the envoronment (and other global login settings) from your .profile become visible to all X programs, not only xterm. For instance put: . ~/.profile at the beginning of our ~/.xsession If you're using xinit(1), your ~/.profile is already loaded by the login shell.