6

How to open Terminal in current opened folder in nautilus?

There are solutions: Keyboard shortcut for open terminal Nautilus >= 3.16

But they don't work in Ubuntu Bionic 18.04

vrcmr
  • 6,307

1 Answers1

2

tl;tr You already found the answer it just needs some affection.

So just repeat it, click around and restart nautilus/relog/reboot until it starts working.


I wasn't aware that this is possible but now after reading your question I was intrigued.

So long story short: it's a bug. Its on GitLab and also on BugZilla.

Fortunately, custom scripts still work and you already found the answer for those. However, as you described, following the steps provided did not work - likely another bug.

After fiddling around for half an hour I got it working:

  1. Follow the steps from the linked answer:

    1. create file Terminal in ~/.local/share/nautilus/scripts with content:

      #! /bin/bash
      gnome-terminal
      
    2. make it executable chmod +x ~/.local/share/nautilus/scripts/Terminal

    3. add F4 Terminal to ~/.config/nautilus/scripts-accels (or some other key)
  2. nautilus -q or log out and log in again (to be sure)

  3. Open Natilus

  4. Press F4 (nothing happens)

  5. Right click a folder, select Scripts > Terminal -> Go back to Nautilus

  6. Press F4 again - it will work as expected.


Expected result should look like this (just in your default language):

AEM
  • 1,166
  • 2
    May be of intetest to you...I use Dolphin under Kubuntu instead of Nautilus, and I don't know if it is possible to run it under Ubuntu with Gnome, but it can display a terminal window beneath the normal folders & files window, and as you click through your folders the terminal cd's to the same directory...fab! – B.Tanner Aug 04 '18 at 10:31
  • Sorry. It doesn't work for me. So it is a bug ... – vrcmr Aug 05 '18 at 11:10
  • @vrcmr Which part doesn't work? Is the menu entry for scripts not added, is the hotkey not applied (printed in light grey on the right side of the entry, see added picture) or is that all working and it just happens nothing when you press the key? – Fabian N. Aug 05 '18 at 11:30
  • 1
    I got GUI entry like you. The difference that I see there is no 'F4' on the right of 'Terminal' entry on my system. I switched now to ranger for development. And nautilus for pictures videos and so on. – vrcmr Aug 05 '18 at 12:23
  • @vrcmr Ok... some last ditch effort before I give up: killall nautilus then remove nautilus (see here https://askubuntu.com/a/880422/627247), move ~/.config/nautilus away, reinstall it, now recreate scripts-accels and add only F4 Terminal ... finally, check its version nautilus --version (should be 3.26.3 atm) and then start it from cmd via nautilus and look for any error output... – Fabian N. Aug 05 '18 at 13:11
  • you can not reinstall nautilus because ubuntu-desktop depends on it. – vrcmr Aug 06 '18 at 12:23
  • Sure you can, you just have to do it without removing all the dependencies (see the linked answer above) sudo dpkg --purge --force-depends nautilus and then sudo apt install nautilus – Fabian N. Aug 06 '18 at 12:43
  • The linked answer https://askubuntu.com/questions/680016/keyboard-shortcut-for-open-terminal-nautilus-3-16/696901#696901 works for me in Ubuntu 19.04 – rofrol May 15 '19 at 07:50
  • 1
    Providing the executable permissions to the Terminal script worked for me! – Nagabhushan S N May 30 '19 at 09:02