The $PATH I have when I run terminal in an nX session is different to that I have when I run terminal after logging on physically.

The former is


while the latter is


The latter has /home/agrimm/bin/ while the former doesn't (and yes, I've rebooted since creating /home/agrimm/bin)

I suspect the difference is that .profile is getting run in the latter, but not in the former.

https://askubuntu.com/a/279374/14772 has in the last paragraph:

Non-login shells have login shells (or something that behaves like a login shell) as their parent, and inherit most of their environment variables, including PATH, from this login shell. So putting path-modifying commands in ~/.profile requires that you log out and back in for them to be effective, but it affects the environment of non-login shells too (as well as the environment for programs that are not shells, since every program gets its own set of environment variables--called its "environment"--inherited from its parent process).

I assume that logging in with nX is "something that behaves like a login shell", and that when I run terminal, the parent process of terminal ought to provide it with a complete $PATH, including home/agrimm/bin.

Is my assumption correct? If so, how do I get nX to run .profile?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.