Open terminal menu shortcut becomes invalid when a folder is selected

Bug #521029 reported by SiegeLord
28
This bug affects 3 people
Affects Status Importance Assigned to Milestone
nautilus-open-terminal (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: nautilus-open-terminal

System: Ubuntu 9.10 32 and 64 bit, Nautilus 1:2.28.1-0ubuntu3 with the nautilus-open-terminal 0.17-1 installed.

Bug: I have assigned a shortcut to the open terminal action in the menu by highlighting it, and pressing F4. This works fine when only a file or nothing is selected in the main window: I press F4 and the terminal opens up in the correct location. However, if I select a folder in the main window, pressing F4 no longer does anything. Moreover, if I open up the File menu it shows the shortcut key for the open terminal action to be '-/-' i.e. dash-slash-dash. It shows the bound key, F4, in the previous case. If I try to assign the shortcut key again while it reads the '-/-' Nautilus crashes.

To be perfectly clear, the crash is not really the issue here (it is possibly a symptom, though). What should happen is that the shortcut key should maintain its state and work when a folder is selected. I imagine the action would be to open the terminal in the selected folder (and not the current folder).

Revision history for this message
Daniel Gnoutcheff (gnoutchd) wrote :

Thanks for discovering the pattern, SiegeLord! I can confirm this, and I've now noticed that the keyboard shortcut for "open in terminal" is broken if _and_only_if_ the selection consists of exactly one folder. If I clear the selection, or if I include some regular files in the selection, or if I select more than one folder, then the bug goes away.

I've also noticed that various nautilus windows are independent with respect to this bug. If a single folder is selected in one window, "open in terminal" is broken in that window only; other windows continue to work fine, assuming that the selections there consist of something other than a single folder.

I note that the case of a single folder being selected is a special case for nautilus-open-terminal: "Open in Terminal" opens a terminal in the selected folder, rather than the folder displayed in the window. So it makes sense that this special case would have different (broken) behavior.

Apport trace of the segfault at (duplicate) bug # 555371.

Revision history for this message
Daniel Gnoutcheff (gnoutchd) wrote :

Just noticed another, probably closely-related problem: normally, "open in terminal" shows up in 2 places, the context menu and in the file menu. However, when a single folder is selected, "open in terminal" appears in *3* places, the context menu, file menu, and the edit menu. I'm guessing that's not intended behavior.

Revision history for this message
SiegeLord (siegelords-abode) wrote :

Okay, I think I managed to work out a solution to this. What I think happens is that this extension adds two separate action (one a background action, that you can invoke via the File menu if you are selecting nothing; and a file action, that you can invoke when you select a folder). The problem is that the extension assigns both actions the same action type, which I think confuses Nautilus. I made a patch to call the file version of the action something different. The patch seems to work fine for me.

Here are some instructions for users who want to try this:

First, install the build dependencies for the extension:

sudo apt-get build-dep nautilus-open-terminal

Then, fetch the source:

mkdir nautilus-open-terminal
cd nautilus-open-terminal
apt-get source nautilus-open-terminal
cd nautilus-open-terminal-0.18

At this point, download my patch and put it into that folder (nautilus-open-terminal/nautilus-open-terminal-0.18/). Then do this:

patch -p1 < openterminal_patch.diff
dch -l custom "Open terminal with folder selected fix."
dpkg-buildpackage -b -us -uc -rfakeroot

After the package has built, you just install it in your favourite way. From the command line it'll be (the .deb file might be different if you're not on 64 bits):

dpkg -i ../nautilus-open-terminal_0.18-1custom1_amd64.deb

Now you have to restart nautilus. I do it by issuing this:

killall -9 nautilus
nautilus

The nautilus should now have the fixed open terminal extension.

Revision history for this message
SiegeLord (siegelords-abode) wrote :

Should be:
sudo dpkg -i ../nautilus-open-terminal_0.18-1custom1_amd64.deb

tags: added: patch
Revision history for this message
Julien Valroff (julienv) wrote :

I've just forwarded your patch to the upstream developer.
Now waiting for him to review it and commit the changes if OK.

Cheers,
Julien

tags: added: patch-forwarded-upstream
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.