12

I am looking for a way to close the currently focused window using a keyboard shortcut. Effectively I want to do the same thing as the red "X" button in the top left corner, only using a keyboard. On windows/linux this is done by alt+f4

I know about:

  • ⌘ Cmd+w - in any tabbed application such as google chrome it will close the current tab instead of current window
  • ⌘ Cmd+q - will close the entire app instead of just the current window
1
  • 1
    Years later, and mac still lacks a universal way to close windows using the keyboard :/ Mar 28, 2019 at 19:46

4 Answers 4

8

Shift+⌘ Cmd+w does what you want in Safari and Chrome. I don't think it's a system-wide standard, though.

It works in Finder too so maybe it is a standard.

https://support.google.com/chrome/answer/157179?hl=en

1
  • 1
    cmd/shift/w is a pretty much the global command for 'close all windows'. As most apps on Mac won't quit when the last window is closed, I guess this is as close as you will get, but it is not the equivalent of alt/F4, as that will quit the frontmost process. On Windows, having two windows open means you have two running processes, on Mac it doesn't.
    – Tetsujin
    Sep 15, 2015 at 19:03
2

BetterTouchTool (http://www.bettertouchtool.net) lets you assign many actions to trackpad and magic mouse gestures / mouse buttons / keyboard shortcuts. The "Close Window below cursor" action might be close to what you want

2
  • I am hesitant about installing apps outside of app store (aside of big players such as google chrome), I simply do not trust most authors Sep 15, 2015 at 19:46
  • 2
    Well, I (kinda) understand that. The developer (Andreas Hegenberg, blog.boastr.net) has been developing BetterTouchTool, among other tools (some of which are also released on the app store), for more than 4 (?) years. It has been reviewed by many journalists (for example on Macworld macworld.com/article/1157058/trackpadtricks.html) and is widely used by Mac users. BetterTouchTool is, in my opinion, a Macbook's killer "app". Many great applications (not apps, applications) only exist outside the app store. Being careful about what you install and from where is important, but don't miss out!
    – Brethil
    Sep 15, 2015 at 22:17
1

I believe that ⌘ Cmd+w IS what you are looking for. It doesn't just work for tabbed applications, such as browsers. I tested it in Finder this morning, the OS X Mail App, as well as Microsoft Word and Excel. All of those support using the ⌘ Cmd+w combination to close the current window.

0

The command to close the current focused window is Opt+Cmd+W.

1
  • That seems to close all open windows in the foreground app (leaving the app running). (Tested on several apps on macOS 12 Monterey.)
    – gidds
    Feb 10, 2022 at 20:31

You must log in to answer this question.

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