Description of problem: After using "Open in Terminal" from Files, new terminal windows created from that terminal run bash with several important environment variables unset, including $HOME. Version-Release number of selected component (if applicable): gnome-terminal-3.38.0-1.fc33.x86_64 gnome-terminal-nautilus-3.38.0-1.fc33.x86_64 How reproducible: Always Steps to Reproduce: 1. In Files, use "Open in Terminal" on a folder. 2. From the resulting terminal window, open a new terminal window or a new tab in the same window - Ctrl+Shift+N or Ctrl+Shift+T. Actual results: The shell started in step 2 is missing many environment variables that are set in the shell started in step 1. Several of these are pretty important: $HOME, $USER, etc. Expected results: The environment variables in the two shells should be the same (or maybe a few small differences in values like GNOME_TERMINAL_SCREEN, but the set of keys should definitely be the same). Additional info: Compared to opening a fresh terminal and `cd`ing to the target directory, the shell in step 1 has these extra env variables set: G_ENABLE_DIAGNOSTIC, INVOCATION_ID, MANAGERPID, JOURNAL_STREAM. Compared to the shell in step 1, the shell in step 2 is missing these variables: SHELL, SESSION_MANAGER, HISTCONTROL, XDG_MENU_PREFIX, HOSTNAME, SSH_AUTH_SOCK, XMODIFIERS, DESKTOP_SESSION, LOGNAME, XDG_SESSION_DESKTOP, XDG_SESSION_TYPE, XAUTHORITY, GDM_LANG, HOME, USERNAME, XDG_CURRENT_DESKTOP=GNOME, WAYLAND_DISPLAY, G_ENABLE_DIAGNOSTIC, MANAGERPID, GNOME_SETUP_DISPLAY, XDG_SESSION_CLASS, USER, DISPLAY, QT_IM_MODULE, XDG_RUNTIME_DIR, JOURNAL_STREAM, GDMSESSION, DBUS_SESSION_BUS_ADDRESS, MAIL
Upstream https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/253 and worked around in 3.38.1.
Thanks, I'll test that as soon as there's a build, but from reading the bug reports it sounds like a different issue. It sounds as if the problem in #253 you linked to is that the new terminal is inheriting its environment from gnome-terminal-server. But the environment I'm getting is missing all kinds of things that are present in g-t-s's environment, like $HOME. Check with cat /proc/$(ps -C gnome-terminal- -o pid:1=)/environ | tr '\0' '\n' and see HOME, USER, HOSTNAME etc are all set.
3.38.1 does not fix this. Tested with: gnome-terminal-3.38.1-1.fc33.x86_64 gnome-terminal-nautilus-3.38.1-1.fc33.x86_64 This is definitely a different issue. Note that it also means $PATH is mangled badly: the default .bashrc adds $HOME/.local/bin and $HOME/bin to the PATH, but with HOME unset you get /.local/bin and /bin instead. So per-user installed stuff stops working.
Can confirm, I'm hit by this too, on fedora 33 stable. Sometimes new gnome-terminal windows do not seem to inherit the correct / full environment. HOME, USER, SSH_AUTH_SOCK, DESKTOP_SESSION, XDG_SESSION_DESKTOP, XDG_SESSION_TYPE, XAUTHORITY, XDG_SESSION_CLASS, DISPLAY, DBUS_SESSION_BUS_ADDRESS and others are missing (leading to problems with SSH and launching graphical applications). PATH is mangled to "/usr/lib64/ccache:/usr/local/bin:/usr/bin".
This looks like https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/303 which has a patch linked in the comments.
(In reply to Sebastian Keller from comment #5) > This looks like https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/303 > which has a patch linked in the comments. The proposed patch in the upstream issue works for me. I've created a Copr repo with the fixed version of GNOME Terminal: https://copr.fedorainfracloud.org/coprs/tadej/gnome-terminal-f33/ I've also opened a PR so this can get included in Fedora's GNOME Terminal package: https://src.fedoraproject.org/rpms/gnome-terminal/pull-request/4
I just updated to Fedora 34 and was very disappointed to find that the default version of gnome terminal still has this bug.
FEDORA-2021-f2f97366ff has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-f2f97366ff
FEDORA-2021-2a26a789e4 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-2a26a789e4
FEDORA-2021-2a26a789e4 has been pushed to the Fedora 33 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-2a26a789e4` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-2a26a789e4 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-f2f97366ff has been pushed to the Fedora 34 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-f2f97366ff` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-f2f97366ff See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-f2f97366ff has been pushed to the Fedora 34 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2021-2a26a789e4 has been pushed to the Fedora 33 stable repository. If problem still persists, please make note of it in this bug report.
*** Bug 1917145 has been marked as a duplicate of this bug. ***