X sessions and login shells

James Wilkinson ubuntu at westexe.demon.co.uk
Sat Apr 16 21:27:35 UTC 2005


Richard Downer wrote:
> I've been playing around with command line shells in the last couple
> of days - I still spend a lot of time at the command line so it's
> worth spending a bit of time getting that environment perfect.  At the
> moment I'm trying out zsh (which may or may not be relevant to this
> problem.)
> 
> With shells there is a distinction between the "login shell" and other
> shells - one difference being that a login shell will execute
> 'profile' scripts.  For bash, as I remember, these are /etc/profile
> and ~/.bash_profile.  zsh has equivalents with different names.  These
> profiles are for setting global environment variables - I'm using
> these to set EDITOR and JAVA_HOME variables.
> 
> Now when I log in at a text console, EDITOR and JAVA_HOME are set, as
> expected.  But, when I log in at the X graphical screen, EDITOR and
> JAVA_HOME are *not* set - which suggests that although I'm "logging
> in" at no point is a login shell invoked and the profiles run.
> 
> Am I right - logging in through X does not invoke a login shell and
> does not load profiles?  If so, why?

Are you using GNOME Terminal?

If so, you might want to select the Edit menu, the Current Profile
option, the Title and Command tab, and see what "Run command as a login
shell" does for you.

Hope this helps,

James.

-- 
E-mail address: james | Which do you consider was the stronger swimmer,
@westexe.demon.co.uk  | (a) The Spanish Armadillo,
                      | (b) The Great Seal?
                      |     -- '1066 and All That'




More information about the ubuntu-users mailing list