Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for some way to unplug the Ctrl+W shortcut in Nautilus that closes the window. The reason is that when I drag a file out of Nautilus into my text editor, I almost always close it after reading some snippet for about 3 seconds. But when I press Ctrl+W to close my file, Nautilus wants to be the application in focus, so it takes the keystroke and closes the Nautilus window.

It would actually be better for Nautilus to release focus to the drop target when a file is dragged out--or even better, never take focus at all, just be visible but not a focusable window. But this seems like it would be difficult to accomplish, so I'd be happy with a way to turn off Ctrl+W. Does anyone know of a way?

share|improve this question
up vote 2 down vote accepted

No, you can't do that. Keystrokes will go to whichever window has focus. The easiest thing to do is simply click once on the text editor after drag & dropping your file to it. That will give the window focus.

share|improve this answer

You can disable the CTRL + W shortcut in Nautilus by adding the following line to ~/.config/nautilus/accels and then rebooting:

(gtk_accel_path "<Actions>/ShellActions/Close" "")

This sets the keyboard shortcut (accelerator) for the close action to nothing instead of the default of "<Primary>w".

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.