Sub topic 3
Switching, closing, and hiding apps and windows
This chapter assumes you know the modifier symbols from the first chapter (⌘ Command, ⌥ Option, ⌃ Control, ⇧ Shift). It also assumes you know what an app, a window, and the Dock are. The goal is to manage a crowded desktop without the mouse. You will learn the difference between closing, quitting, hiding, and minimizing, because each one leaves the app in a different state.
Apps and windows are different things
macOS separates an app from its windows. An app is a running program. A window is one view of that program. One app can have many windows (several Finder windows), and an app can run with no windows at all.
This explains most surprises. Closing the last window of Mail usually leaves Mail running. Switching to an app does not always bring all of its windows forward. The shortcuts in this chapter fall into two groups: those that act on apps, and those that act on windows.
| Goal | Acts on | Shortcut |
|---|---|---|
| Switch to another app | App | ⌘Tab |
| Switch to another window of the same app | Window | ⌘` |
| Close the front window or tab | Window | ⌘W |
| Close all windows of the front app | Window | ⌥⌘W |
| Quit the front app | App | ⌘Q |
| Hide the front app | App | ⌘H |
| Hide every app except the front one | App | ⌥⌘H |
| Minimize the front window to the Dock | Window | ⌘M |
| Minimize all windows of the front app | Window | ⌥⌘M |
Switching between apps with ⌘Tab
Hold ⌘ and press Tab. The app switcher appears, listing running apps with the most recently used first. Each press of Tab moves the highlight one app to the right. When you release ⌘, macOS switches to the highlighted app.
Because the list is ordered by recent use, a single quick ⌘Tab toggles between your two most recent apps. This is the most useful form of the shortcut. While you write a document and read a reference page, press ⌘Tab, read, and press ⌘Tab again.
For anything beyond the previous app, keep ⌘ held down and use these keys while the switcher is open:
⌘Tab Open the switcher and move right (hold ⌘ down)
⇧⌘Tab Move left (hold ⌘, then add Shift while pressing Tab)
← or → Move the highlight with the arrow keys
Q Quit the highlighted app
H Hide the highlighted app
↑ or ↓ Show the highlighted app's windows
Esc Cancel and stay where you arePressing Q and H in the switcher is a quick way to clean up. You can walk across the list and quit apps you no longer need without releasing ⌘. Check the highlight before you press Q, because the keystroke acts immediately.
Restoring a minimized window while switching
If an app has only minimized windows, ⌘Tab brings the app forward but shows nothing. The Dock icon becomes active and no window appears. To restore the window, hold ⌥ when you release ⌘. Release ⌘ while ⌥ is still down, and the minimized window comes back. If you forget, press ⌘N or click the Dock icon.
Switching between windows of one app with ⌘`
⌘Tab moves between apps. To move between windows inside one app, such as two Safari windows or three Finder windows, press ⌘` (Command and the grave accent key). On a US keyboard, that key sits above Tab.
Each press cycles to the next window of the front app. Add Shift (⇧⌘`) to go the other way. When you have two windows, the shortcut toggles between them.
Keyboard layouts differ. On many non-US layouts the key above Tab is not the grave accent, and ⌘` may be missing or awkward to reach. You can check or change the shortcut in System Settings, under Keyboard, Keyboard Shortcuts, Keyboard, "Move focus to next window". A later chapter covers customizing shortcuts.
Closing: window versus app
⌘W closes the front window. In apps with tabs, such as Safari, Finder, and Terminal, it closes the front tab first. The window closes when its last tab does. Use ⌘W for tabs, documents, and dialogs.
Closing a window does not necessarily quit the app. For many apps, the app keeps running with no windows. You can tell this from the Dock, where a small dot appears under the icon of every running app. Quit the app with ⌘Q if you want it gone.
Other related shortcuts:
- ⌥⌘W closes all windows of the front app. In Finder, this clears every open folder window.
- ⇧⌘W closes the whole window rather than a single tab in apps that use tabs. Safari and Finder both follow this.
- ⌘Q quits the front app. If a document has unsaved changes, the app asks you to save, discard, or cancel.
When an app stops responding and ⌘Q does nothing, use Force Quit. The system shortcuts chapter covers it (⌥⌘Esc).
Hiding and minimizing
Hiding and minimizing both clear your screen, but they work differently.
- Hide (⌘H) removes all windows of the app from view without changing them. The app keeps running and has no Dock thumbnail. Switching back to it with ⌘Tab or a click on the Dock icon restores every window exactly as it was.
- Minimize (⌘M) shrinks one window into the right side of the Dock. Each minimized window has its own thumbnail. You restore a window by clicking it or by using ⌥ with ⌘Tab, as described above.
Hide suits whole apps you want out of the way. Minimize suits individual windows. Hiding is usually the better habit because it leaves the Dock tidy and it is easy to reverse with ⌘Tab.
Two related shortcuts act on a larger scope:
- ⌥⌘H hides every app except the front one. This is a fast way to focus. It works well before a screen share, or when you want one app and nothing else.
- ⌥⌘M minimizes all windows of the front app into the Dock.
You can also press ⌥⌘D to show or hide the Dock itself. This helps when you want the full screen height, and it only changes the Dock's visibility.
Full-screen mode
Some tasks need one window to fill the display. Press ⌃⌘F to enter and leave full-screen mode in most apps. On recent macOS versions, pressing the fn key with F does the same. A full-screen window gets its own Space. You can reach it with ⌘Tab or with the Space-switching shortcuts, which are covered in the Mission Control chapter.
A decision map
When you want a window or app out of the way, pick the shortcut by what you want to happen next.
A worked sequence
Here is a realistic workflow that combines these shortcuts. You are writing a report in a text editor with a browser open for reference, and a chat app and a mail app running in the background.
⌘Tab Jump to the browser (the previous app)
⌘` Move to the second browser window with your notes
⌘W Close that notes tab when done
⌘Tab Return to the editor
⌥⌘H Hide the browser, chat, and mail so only the editor shows
⌘Tab Later, bring the browser back (hidden apps stay in the list)Notice that you never touch the mouse and never lose your place. Hidden apps remain in the ⌘Tab list, so hiding costs nothing to undo.
Common errors and how to avoid them
- ⌘Tab does not show a window. The app has only minimized windows or no windows. Hold ⌥ when you release ⌘ to restore a minimized window, or press ⌘N for a new one.
- ⌘` seems to do nothing. The app has only one window, or the key does not map to the grave accent on your layout. Check the "Move focus to next window" setting.
- The app is still running after ⌘W. This is normal. Look for the dot under the Dock icon, then use ⌘Q.
- You quit the wrong app from the switcher. Q acts on the highlighted app immediately. Watch the highlight before you press it.
- A hidden app seems to be missing. It is not gone. Hidden apps stay in ⌘Tab and in the Dock with a dot. Use ⌘Tab to bring them back.
- ⌘H seems to do nothing in a full-screen window. The app is in its own Space. Leave full screen first (⌃⌘F), then hide the app.
Where this leads
Switching between apps and windows covers what is on your current desktop. When you have many windows, Mission Control gives you an overview, and Spaces let you group windows on separate desktops. Those are the subject of a later chapter, and they use the same modifier keys you have been using here.
Exercise
You are in Safari with two windows open. You press ⌘Tab to leave for Mail, then want to go back to the other Safari window, not the one you were last using. Which shortcuts do you use, and in what order?
Show answer
Press ⌘Tab to return to Safari. This brings forward the most recently used Safari window. Then press ⌘ to cycle to the other Safari window. ⌘Tab moves between apps and ⌘ moves between windows of the front app.
Exercise
You close the last window of Mail with ⌘W, and a colleague asks why Mail still shows a dot in the Dock. What happened, and how do you fully quit it from the keyboard?
Show answer
⌘W closes a window, not the app. Mail is still running with no windows open, which the dot under its Dock icon shows. Make Mail the front app with ⌘Tab, then press ⌘Q to quit it. Alternatively, hold ⌘Tab, highlight Mail, and press Q.
Exercise
You are about to share your screen and want only your presentation app visible, without quitting anything. Which shortcut do you use, and how do you restore a hidden app afterward?
Show answer
With the presentation app in front, press ⌥⌘H to hide every other app. Afterward, press ⌘Tab to select a hidden app and release ⌘. Its windows return exactly as they were.