Opening a terminal window in the current Nautilus directory

Keith Irwin keith at keithirwin.com
Sun Oct 31 20:10:18 UTC 2004


Steve Zatz wrote:
> This is a real newbie question but I don't see a way to open a
> terminal window where the working directory is the same directory that
> a Nautilus window is currently open to.  To be as clear as possible,
> when I am pretty deep in the file system with Nautilus I only see how
> to open a terminal window in my home directory and then I have to cd
> to the directory that I am trying to get to.  Is there a better way?

Actually, you used to be able to do this easily in earlier versions of 
nautilus.  All you had to do is choose the "open with" option on a 
folder, then go to the dialog where you choose applications.  One of 
those applications was "terminal".  You could then set it to show up in 
the menu.

This worked great.

See:

	http://bugzilla.gnome.org/show_bug.cgi?id=151747

for a discussion about how/why it was removed sometime in the 2.7 
development phase.

You can _still_ right click, choose properties, and add "gnome-terminal" 
or whatever to the list of apps that can open a folder, but for some 
reason, nautilus will no longer allow you to see these options on the 
right-click menu.

If you set the open-with properties, then use the "browse" window 
instead of spatial mode, you'll see "open with" and "open with 
gnome-terminal" in the information pane, but clicking them does nothing.

So, I think this is a bug having something to do with the new mime 
system, or I think the nautilus developers have incompletely rolled back 
the feature.

For now, what I did was wrote a python app, then created a launcher in 
my top panel and I just drag folders to it to open them.

launcher:  /home/keith/Bin/termish.py %f

Script:

----
#!/usr/bin/env python

import sys
import os

path = os.environ["HOME"]

if len(sys.argv) > 1:
     path = sys.argv[1]

exec_str = "gnome-terminal --working-directory=%s" % path

os.system(exec_str)
----

This was a lot of fun to write, but I'd prefer a proper "open with" menu 
for folders, just like for every other object on the desktop.

Keith




More information about the ubuntu-users mailing list