I'm opening the terminal by pressing Window + 2
. I want that to open in ~/some-custom-directory
Thing is, I want new tabs within the terminal window to NOT be affected by this behavior, i.e. if I'm in ~/other-directory
and open a new tab, I want it to open in the same directory ~/other-directory
, and not default to ~/some-custom-directory
Is this possible? Can I change the behavior of opening a terminal window without it affecting opening a terminal tab?
It already works like you wish by default.
--working-directory
, e.g.gnome-terminal --working-directory ~/some-custom-directory
~/other-directory
, a new tab will also open in~/other-directory
.To have that work for the shortcut key Super+2, which launches or switches to the application that is the 2nd favorite on your dock (in your case, that is the terminal), edit the
.desktop
launcher involved./usr/share/applications/org.gnome.Terminal.desktop
to your localapplications
directory (~/.local/share/applications
)..desktop
file and add the option to the command in theExec=
line. Note that here, you need to indicate the full path name, because bash expansion (~
) or variable substitution (e.g.$HOME
) does not work in.desktop
launchers. The customized copy will take precedence over the default one, so within seconds, your shortcut key should launch your terminal in the directory of your choice (of course, only if Terminal was not running - if it is running, the shortcut key will only bring the running instance forward without changing directories).