1

I currently use ctrl+w for closing application windows. ctrl+w is also Firefox's shortcut for closing a tab.

Is it possible to keep both, so therefore ignoring the global shortcut for ctrl+w when Firefox is focused?

I regularly have this sort of problem with keyboard shortcut clashes with at least one program, so any solution to get an application to ignore a shortcut is highly valuable.

3
  • 1
    Interesting question, but this is not possible a.f.a.i.k. Global shortcuts take precedence over these defined at the level of the application, and there is no way I know to change that,
    – vanadium
    Feb 14, 2022 at 15:36
  • I am using ctrl+q for close window now. Some applications natively recognize ctrl+w for close window, rather than application. Try it on document preview. Not sure it is recognized in all apps though.
    – apg
    Feb 15, 2022 at 16:41
  • 1
    Many applications including firefox use Ctrl+q to quit the application. You indeed can override that with a systemwide shortcut that closes the current window. I disable the Ctrl+q shortcut altogether because it is in my opinion too easily triggered. It is the classical Alt+F4 for me.
    – vanadium
    Feb 15, 2022 at 17:12

2 Answers 2

1

go to about:config in firefox, and set browser.tabs.closeWindowWithLastTab to false

that will make ctrl+w to close the last tab but keep browser open.

0
0

It is often possible to set shortcuts within applications for e.g. close window. For example, for closing a terminal window like a firefox tab, try opening a terminal and right-clicking for Preferences, then Shortcuts, and setting Close Window to ctrl-w.

Then you can globally set close window in Ubuntu to something else (like ctrl-q), and Firefox can use ctrl-w for closing tabs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .