Prevent accidental quits and window closes by requiring long-press on ⌘Q / ⌘W
Features • Installation • Usage • Configuration • Building • License
- 🛡️ Prevent Accidental Quits — Hold ⌘Q to quit; a brief tap does nothing
- 🪟 Prevent Accidental Window Closes — Hold ⌘W to close a window; a brief tap does nothing
- ⏱️ Customizable Duration — Adjust hold time from 0.3 s to 3.0 s
- 📋 App Exclusion List — Exempt specific apps so they quit/close immediately
- 🌐 Multi-language — English, Chinese (Simplified), Japanese, Russian
- 🎨 Native macOS Design — Progress ring overlay blends with the system UI
- 💾 Persistent Settings — Configuration saved to JSON
- macOS 14.0 (Sonoma) or later
- Accessibility permission
- Download the latest release from Releases
- Open the DMG file
- Drag
SlowQuitApps.appto theApplicationsfolder - Open the app and grant Accessibility permission when prompted
git clone https://github.com/030201xz/slow-quit-apps.git
cd slow-quit-apps
./build.sh-
Grant Accessibility Permission
- Open the app — System Settings opens automatically
- Go to: Privacy & Security → Accessibility
- Toggle SlowQuitApps to ON
- Click Restart App in the settings window
-
Configure in the menu bar
- Click the menu bar icon
- Enable ⌘Q / Disable ⌘Q — toggles long-press-to-quit
- Enable ⌘W / Disable ⌘W — toggles long-press-to-close-window
- Settings… — adjust hold duration, exclusion list, language
| Action | Result |
|---|---|
| Tap ⌘Q briefly | Nothing (quit cancelled) |
| Hold ⌘Q for the set duration | App quits |
| Release ⌘Q early | Quit cancelled, ring resets |
| ⌘Q on an excluded app | Quits immediately |
| Tap ⌘W briefly | Nothing (close cancelled) |
| Hold ⌘W for the set duration | Window closes |
| Release ⌘W early | Close cancelled, ring resets |
| ⌘W on an excluded app | Closes immediately |
~/Library/Application Support/SlowQuitApps/config.json
| Key | Description | Default |
|---|---|---|
quitOnLongPress |
Enable long-press for ⌘Q | true |
closeWindowOnLongPress |
Enable long-press for ⌘W | true |
holdDuration |
Hold time in seconds | 1.0 |
launchAtLogin |
Start at login | false |
showProgressAnimation |
Show progress ring | true |
language |
UI language | en |
excludedApps |
Apps exempt from interception | Finder, Terminal |
| Code | Language |
|---|---|
en |
English |
zh-CN |
简体中文 |
ja |
日本語 |
ru |
Русский |
- Xcode 16.0+ or Swift 6.0+
- macOS 14.0+
# Development build
swift build
# Release .app bundle (ad-hoc signed)
./build.shslow-quit-apps/
├── Sources/SlowQuitApps/
│ ├── App/ # Application entry point & menu bar
│ ├── Core/
│ │ ├── Accessibility/ # CGEvent tap, permission management
│ │ └── QuitHandler/ # Progress ring UI & controller
│ ├── Features/
│ │ └── Settings/ # Settings window (General, App List, About)
│ ├── Models/ # ManagedApp model
│ ├── State/ # AppState (observable, persisted)
│ ├── Utils/ # Config, LaunchAtLogin, I18n
│ └── Resources/ # Locale JSON files
└── BuildAssets/ # App icon, DMG docs
Ad-hoc signed apps lose their accessibility trust when the binary changes. After every rebuild, go to System Settings → Privacy & Security → Accessibility, remove SlowQuitApps, then add it back and restart the app.
- Confirm Accessibility permission is granted
- Click Restart App in settings
- Make sure the target app is not in the exclusion list
- Check that the corresponding toggle (⌘Q or ⌘W) is enabled in the menu bar
Contributions are welcome. Please open an issue or pull request.
MIT License — see LICENSE for details.
Made with ❤️ for macOS