[Bug 17962] Re: newly opened gnome-terminal windows don't have .bash_profile sourced

Micah Cowan micah at cowan.name
Wed Oct 16 16:25:17 UTC 2013


No argument of any sort was made in #8, specious or otherwise; only an
observation.

"And placing "profiley" stuff into bashrc slows down the shell (as if
it's not slow enough already!)"

Adding things to PATH that you want access to in all your interactive
shells, belongs in the file sourced by interactive shells, not merely
login ones. There's nothing "profiley" about that. And it would be
entirely inappropriate for GDM or ~/.xsession or the like to source a
bash-specific profile script file (as ~/.bash_profile surely is) without
the user configuring it to do so, most particularly when bash isn't the
usual system shell under which those things would be running (and it's
certainly not interactive).

Interactive shell stuff goes in the ~/.foorc (~/.bashrc, ~/.kshrc, what
have you); MOTD  and other "once-only", truly profilish-type setup stuff
goes in the profile source files, and none of those should be sourced by
non-interactive X shell scripts (such as ~/.Xsession) running under
/bin/sh (= dash). There's a reason why the default ~/.profile sources
~/.bashrc, and does nothing else by default (though, if it's going to
source ~/.bashrc, it ought to have been a ~/.bash_profile, and not
~/.profile, but that's an entirely separate issue).

It has been the case for _decades_ that terminal emulators by default
spawn interactive, non-login shells. Changing this to satisfy a few
people who failed to configure their interactive shells correctly, would
surely cause more harm to those who expect things to work the way they
always have, than benefit to those who are confused about how to
properly set up their source files.

Bottom line, you want your profile sourced, configure your emulator to
spawn login shells. Not hard: "/bin/bash -l" versus "/bin/bash". And if
you want certain items to be in your PATH across all interactive shells,
put it in the correct file.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bash in Ubuntu.
https://bugs.launchpad.net/bugs/17962

Title:
  newly opened gnome-terminal windows don't have .bash_profile sourced

Status in “bash” package in Ubuntu:
  Invalid

Bug description:
  Unless "Edit->Current Profile->Title & Command-> Run command as login shell" is
  checked, a newly opened gnome-terminal does not source .bash_profile. So, for
  example, ~/bin is not added to $PATH, if ~/bin is present

  This may be the correct behavior, but it is not this way on Fedora Code 3. If
  this is the correct behavior, perhaps the previously mentioned setting should be
  enabled by default.

  Thanks -- Andy

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/17962/+subscriptions



More information about the foundations-bugs mailing list