How do you disable the CTRL+T 'move to trash' shortcut in GNOME/Nautilus?

Help!

10 July 2007, Answered! Thanks to und0 for explaining in the comments. See below...

I just discovered an inconvenient default behavior of the Nautilus file browser. (At least, it appears to be a default in Ubuntu 7.04/Feisty Fawn.) I thought I was in my Firefox window and pressed <CTRL> T to open a new tab, but the focus was in Nautilus and I deleted a file instead. I wasn't quite sure what I did at first since my attention was on the Firefox window. I immediately checked for an "undo" command in the edit menu, but there doesn't seem to be one for Nautilus. (Also quite unfortunate.)

Still not sure what had happened, and like a dummy, I pressed CTRL+T again and this time could clearly see a file disappear, although I hadn't been looking closely at which one I had selected, so now I was missing two files. Only a little bit disturbing since I have backups laying around and these were files I hadn't been working on so they would be in a recent backup. Plus I expected to find them in the trash. I looked there and saw what was probably one of the files, but then I discovered a shortcoming of the GNOME trash folder: it doesn't show when files were deleted. (Or at least, I don't know how to get to that useful piece of information.) So it wasn't easy to tell all the files I had just discarded. (Because who knows, maybe I stabbed at CTRL+T one more time without realizing it.)

It was easy enough to fall back on yesterday's backup to verify which files were missing, but this is not a good keyboard shortcut for me. It's a key combination I use all the time in Firefox and so am likely to do this again, maybe not noticing when I delete a file next time. And it's redundant with the "Delete" key, so is kind of pointless in my opinion. But I can't find where it is configured in order to disable it. I tried System » Preferences » Keyboard Shortcuts, and poked around briefly in gconf-editor, and did several Google searches.

I would have tabled it for later, but decided instead to see if I could harness the power of the lazy web and let you knowledgeable readers tell me where this bad behavior is configured. :-) Any tips would be muchos appreciated.

(Gack! I just did it again while looking for a picture to include with this post!)

Answer

In Nautilus 2.18.1 or thereabout, go to System » Preferences » Menus & Toolbars. Select Editable menu shortcut keys and close the dialog box. Click on the Edit menu in the File Browser and highlight the Empty Trash item. See how it has Ctrl+T listed as the keyboard shortcut? With the the focus on that menu item, press the Delete key to get rid of the shortcut.

GNOME Menu and Toolbar Preferences Dialog

GNOME Nautilus File Menu

Update, 24 February 2008: Thanks to mekura for pointing out that in Nautilus 2.20, the "Editable" option has moved to System » Preferences » Appearance » Interface. The Interface tab is essentially the same as the Menu & Toolbar Preferences dialog, with the exception of the "Detachable toolbars" checkbox which has gone missing.

Alternatively, you could assign a different key combination, but it would be redundant with the more logical and intuitively obvious Delete key itself.

I recommend going back in to the Menu & Toolbar Preferences and re-disabling editable shortcut keys, since this feature is probably even more fraught with peril than the original situation. Take a look at the GNOME help:

Editable menu accelerators

Selecting this option allows you to define new keyboard shortcuts for menu items.

To change an application shortcut key, open the menu, and with the mouse pointer on the menu item you wish to change, press the new combination of keys. To remove a shortcut key, press Backspace or Delete.

When using this feature, you will not be warned if assigning a new shortcut key to a command also removes it from another command.

There is no way to restore the original, default keyboard shortcut for a comamnd. (Oops, someone file a typo report.)

This feature does not maintain shortcuts that are normally common to all applications, such as Ctrl+C for Copy. This may lead to inconsistencies in your GNOME applications.

So there you have it. Thanks again, und0.

If you enjoyed this article, please subscribe for free!
Via the atom or rss feed, or enter your email address to get updates when new entries are posted:
(Your email will not be shared nor used for anything other than sending new posts. See the policies page for more about subscriptions and privacy.)

You can skip to the end and leave a response. Pinging is currently not allowed.

Comments

  1. Tough one to find information on.

    I found this post:

    http://www.kryogenix.org/days/2005/01/23/nautilus

    And posted a question at Ubuntu Forums:

    http://ubuntuforums.org/showthread.php?t=495109

    Planning to ask in the GNOME forums when my account is activated.

  2. From the menu, System -> Preferences -> Menus & Toolbars, activate "Editable menu shortcut keys", now you can change the key bindings (shortcuts) simply selecting the menu entry and inserting a new key combination, or using the "Delete" key to remove the binding (shortcut).

  3. Thank you! That works great, and it's nice that you can disable the feature after making the change to avoid other inadvertent menu changes. I really really really appreciate your help.

  4. Oops! Was careless in referring to the File menu instead of the Edit menu and in creating my screen shot. I had the File menu on there without noticing that has "Empty Trash" instead of "Move to Trash." Fixed now.

  5. Thanks! I've trashed many files by mistake because of this behavior. I'm safer now.

  6. You're welcome -- glad to have been of service.

  7. In Nautilus 2.20, the "Editable menu shortcut keys" option is under 'System' >> 'Preferences' >> 'Appearance' >> 'Interface'

    Sorry for responding to such an old topic, hope this helps.

  8. Hi, mekura -- don't be sorry! I appreciate the tip. I'll update the post soon...

  9. Thanks ... I'm using ubuntu 8.04 and didn't know how to disable this.

    Mekura comment saved my day

    Obrigado

You can follow any responses to this entry through the
comments feed.

Say Your Say

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

By submitting your comment here, you agree to license it under the same Creative Commons Attribution-ShareAlike 3.0 License as the movingtofreedom.org web site. Please see policies for more information about comments and privacy.