Score:0

Shortcut to open the terminal specific directory

ph flag
DBG

I'd like to know the shortcut that lets you open a terminal window in a specific directory just like when you press the left button on it and you click on 'Open in terminal' in the pop-up menu.

Thanks in advance !!

uz flag
Jos
Are you referring to the Nautilus file manager? That [hasn't worked for several releases](https://askubuntu.com/questions/68078/keyboard-shortcut-for-open-a-terminal-here) now. In Nemo, it's F4.
Score:2
ch flag

I have recently moved to Ubuntu 22.04.2 LTS and had the exact issue of not being able to open the terminal on the current directory. For example, in windows I could use alt+d and then write cmd, and the terminal would open in the current directory.

This is the closest I could get to open terminal in the current working directory using just the keyboard (it has a bit more keystroke but might be useful also)

When we are in a folder and want to open the terminal at the same place, then the following keystroke brings the terminal up in the current directory

shift+f10 then two up arrow keystroke and enter

I have to say I came across this by accident while pressing some keys on my keyboard.

I hope it helps :)

UPDATE I: I just noticed one limitation of this approach while using the above-mentioned approach. If I am already selecting one file/folder, then shift+f10 does not open the floating window that has Open in Terminal option, but it opens another floating window that is specifically related to the file/folder I have selected.

UPDATE II: Found a more convinent way shift+f10 + e. This works like a charm (given the limitation mentioned in UPDATE I sadly)

Score:0
cn flag

The shortest way in a default installation is Ctrl+F10 E. There is no single shortcut key to directly open a terminal.

A good way to implement a direct shortcut key is to replace the default extension by a nautilus python extension, nautilus-open-any-terminal. Next to allowing for a single shortcut key, it allows you to substitute a terminal of your choice, if you wish.

  1. Quit nautilus fully

    nautilus -q

  2. Make sure python3-nautilus is installed: sudo apt install python3-nautilus

  3. Install the extension, either using pip as indicated on the website, or by grabbing the source code and placing it in a text file ~/.local/share/nautilus-python/extensions/open_any_terminal_extension.py.

  4. Enable the dconf settings

    glib-compile-schemas ~/.local/share/glib-2.0/schemas/

  5. Define the settings:

gsettings set com.github.stunkymonkey.nautilus-open-any-terminal terminal gnome-terminal

Supply gnome-terminal or any other of the terminals listed in the source code.

gsettings set com.github.stunkymonkey.nautilus-open-any-terminal keybindings '<Ctrl><Alt>t'

to set the Nautilus keybinding for opening the terminal.

gsettings set com.github.stunkymonkey.nautilus-open-any-terminal new-tab true

if you want to open the current directory in a new tab in a running instance. Otherwise, it will be a new window.

Bonus tips:

  • Remove the now superfluous default extension: sudo apt remove nautilus-extension-gnome-terminal.

  • Enable hotkeys in the right-click menu by editing the source code of the extension: where the menu label is defined, add an underscore before the letter you want to activate as a hotkey for the function, as in

    label=_(u"Op_en {} Here").format(terminal.title()),

With this example, also Ctrl+F10 E will work to open a terminal here.

uz flag
Jos
`Ctrl+F10 E` brings up the Properties window on my system.
vanadium avatar
cn flag
@Jos This has become Ctrl+F10+r on Ubuntu 20.10 (Files 40). Anyway, you can select another menu hotkey of course.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.