Jay's blog

Fixing "Open in Terminal" in Pop!_OS

Pop!_OS has this feature in its file manager, Nautilus, that allows you to open a terminal in the current directory using the context menu's "Open in Terminal" option. This is provided by a package called nautilus-extension-gnome-terminal. It opens a new gnome-terminal using the --working-directory command line option set to the directory currently open in Nautilus.

nautilus-open-in-terminal

I don't know when this stopped working properly, but I noticed the issue this evening. It will open a terminal window, but the resulting shell session no longer seems to open in the requested directory.

I futzed with it quite a bit. It will work properly if I run gnome-terminal --working-directory="$PWD" -- bash --norc, which led me to believe that it had something to do with my .bashrc file. It turns out it has nothing to do with my .bashrc file because removing my .bashrc file entirely does not fix it.

My fix (or at least workaround) was to change my gnome-terminal profile setting "Preserve working directory" from "Shell only" to "Always". That seems to do the trick.

gnome-terminal-preferences

This feels really familiar like I've had to deal with it before, but I never blogged about it. It doesn't look like anything has recently changed that would have caused this to suddenly happen. This feature was added to gnome-terminal more than 4 years ago. All relevant packages (gnome-terminal, nautilus, nautilus-extension-gnome-terminal) haven't been updated in more than 6 months. Maybe I just noticed it for the first time on this machine tonight, but it's been like that the whole time. 🤷

#gnome-terminal #nautilus #pop_os