I've found that when logging in graphically the shell loading process works differently than logging in through the console. Environment variables such as $BASH_VERSION and $ZSH_VERSION are not set when logging in graphically, and a script specifically written for bash and zsh that I tried to use while logging in causes the login process to restart and returns me to the login prompt (which stops me from logging in while this script is in place), when logging in through the console the same setup works fine though.

In this chruby-thread on github I talk about the case where I am experiencing the issue. Is the shell loading process working as it should when logging in graphically, and if so is there any documentation on how it works (and if so, where can I find it)? How should I make this work?


If you start a X11 session, the ~/.profile and similar files are not sourced.

If you want to enforce this, create a file /etc/X11/Xsession.d/95-enforce-profile with the following content:

    # This file is sourced by Xsession(5), not executed.
    # source user profile
    if test -e ~/.bash_profile
        . ~/.bash_profile
        [ -e ~/.profile ] && . ~/.profile
  • Sorry for not responding sooner, I didn't see your notification earlier. I don't think this would work, because the script that I have is not compatible with dash (which is the shell that seems to be executing these scripts) – Mark Mar 7 '13 at 8:39

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.