After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 747783 - $PATH variable incorrect for applications started from Nautilus
$PATH variable incorrect for applications started from Nautilus
Status: RESOLVED OBSOLETE
Product: nautilus
Classification: Core
Component: general
3.16.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-13 15:29 UTC by Ulrich Keller
Modified: 2021-06-18 15:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ulrich Keller 2015-04-13 15:29:47 UTC
When I start an application through Nautilus, the $PATH variable is just "/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin". Paths added e.g. in /etc/profile are missing.


Steps to reproduce:

1. Open gnome-terminal using the Shell. Run "echo $PATH". In my case:

/home/uli/GNUstep/Tools:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/opt/mplus/7.2

2. Right-click in a Nautilus window and click "Open in Terminal". Run "echo $PATH" again. I get:

/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin


The $PATH is also incomplete when, for example, I use Nautilus to load a file in Emacs and then start a Shell within Emacs.

I'm using Nautilus 3.16.0 on Arch Linux. There was no such problem with 3.14. PCManFM does not have this problem either.
Comment 1 Christian Klomp 2015-06-07 12:34:23 UTC
Prior to 3.16 in the case of nautilus-open-terminal there was a workaround which involved setting the gnome-terminal option "run command as login shell" but this no longer works.

When looking at the environment of nautilus itself it looks like none of the variables set in the profile files get propagated (I checked the exported variables of ~/.bash_profile with the environments of gnome-terminal, firefox, epiphany and nautilus but only nautilus doesn't inherit these).
Comment 2 Pablo Cholaky Cabezas 2015-06-10 07:27:55 UTC
I can confirm it also, is not loading the file /etc/profile.

Is very easy to debug it, just compare environment variables from gnome-terminal with the "open terminal" from nautilus.

Nautilus 3.16.2 on Gentoo. As Ulrich, I haven't this problem on 3.14.
Comment 3 Elias Toivanen 2015-06-17 20:48:35 UTC
This bug does not just affect the $PATH variable but every other user-specified environment variable as well.

In my case, I set some (G)Vim specific environment variables in ~/.profile, which are then correctly propagated to Gnome shell. Gvim works just fine when launched from the shell. When I then double-click a file in Nautilus, my environment is not honored.
Comment 4 Christian Klomp 2016-05-07 15:35:25 UTC
Still a problem in 3.18.
I need to set GDK_CORE_DEVICE_EVENTS=1 to have reasonable scrolling in LibreOffice GTK3 but this variable is not propagated by Nautilus when opening a document (works fine when LibreOffice is started from the shell or terminal).
Comment 5 André Klapper 2021-06-18 15:33:28 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version of Files (nautilus), then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/nautilus/-/issues/

Thank you for your understanding and your help.