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 trying Gnome Shell, after moving over from Unity. In Unity, I'd press ctrl+w to close the current tab, and alt+F4 to close the current window (e.g. in gedit and Firefox).

Now, in Gnome Shell, ctrl+w is closing the current window instead, and alt+F4 does nothing. I've checked the menu of Firefox, and it says File > Close Tab is ctrl+w as expected. Selecting this item works also.

When I right click my menubar, the minimise/maximise popup menu appears. The last menu-item is "Close", with the associated keyboard shortcut of ctrl+w. Presumably this overrides the application-specific "Close tab" shortcut. I checked System Settings > Keyboard > Shortcuts and "Close Window" was set to "Disabled", so I'm not sure what's going on there...

How can I restore the expected behaviour?

share|improve this question
up vote 3 down vote accepted

Open a terminal with Ctrl-Alt-T keyboard shortcut and try executing this command to fix the problem:

 gsettings set org.gnome.desktop.wm.keybindings close "['<Alt>F4']"

This command will set Alt-F4 as the default binding for closing the window. Then you should use the regular Ctrl-W to close tabs.

After the command, try testing it. Hope this will help

share|improve this answer
Brilliant! In retrospect, I must have changed that in dconf at some stage when messing around in Unity (it was set to ctrl-w). I'm always confused as to why there are multiple places to define keyboard shortcuts (e.g. system settings, dconf, ccsm). Thanks again! – Sparhawk Sep 15 '12 at 7:07
@Sparhawk glad to help you. You can also use dconf-editor, but i avoided that for simplicity. – Anwar Shah Sep 15 '12 at 7:09

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.