[Bug 35649] Gnome session does not get environment variables from .bashrc
Robin Munn
rmunn at pobox.com
Sun Mar 19 22:15:04 UTC 2006
Public bug reported:
https://launchpad.net/malone/bugs/35649
Affects: gnome-session (Ubuntu)
Severity: Normal
Priority: (none set)
Status: Unconfirmed
Description:
Having seen the workaround listed for
https://launchpad.net/distros/ubuntu/+source/ttf-freefont/+bug/33503, I
tried setting MOZ_DISABLE_PANGO=1 in my ~/.bashrc file. I was quite
surprised to discover that bug #33503 did not seem to go away when I did
that. I initially thought that the workaround was wrong, but no -- when
I launched firefox from a terminal window, #33503 did indeed go away.
Then I figured out what was going on -- the launcher icons in the gnome-
panel do not have the environment variables that I set up in ~/.bashrc.
To prove this, I created a quick script called printenv.sh (which just
contained two lines, "set" with no arguments, and then "sleep 1000" so
the terminal window wouldn't go away) and created a new launcher icon in
the panel to run printenv.sh in a terminal window. I ran it, and then
ran "set" with no arguments from the command line to compare the two. My
printenv.sh script, launched from the gnome-panel, printed an
environment that was quite different from the environment of my command-
line. In particular, the environment variables getting set in .bashrc
(such as BROWSER=firefox and MOZ_DISABLE_PANGO=1) were not present in
the environment used by programs launching from the panel. They were
getting properly exported (e.g., "export BROWSER=firefox"), so that's
not the problem.
One other detail: at the start of the .bashrc file, I found the line '[
-z "$PS1" ] && return' with the comment "If not running interactively,
don't do anything". I thought that might be the cause of .bashrc not
getting parsed for progams launched from gnome-session, so I commented
it out. (And then rebooted, to make *absolutely* sure). No change:
environment variables set in .bashrc were still not making it into the
environment of programs launched from the panel.
This is annoying: when I set environment variables in .bashrc, it's
because I want them to be present in the environment of *all* programs I
run after logging in, no matter how I start them. I don't care if
they're started from the terminal, the launcher, or the GNOME menus;
there should be one and only one place to set my environment variables
so that all programs respect them.
More information about the desktop-bugs
mailing list