App Behavior
Make Mac apps behave the way you expect
Choose, app by app, how quitting, closing and windows work, without changing anything for the apps you leave alone.
ed extensions install appBehaviorApp Behavior is an Edith extension that fixes how Mac apps and windows behave. Each fix is off until you turn it on, and app rules apply only to the apps you add.
On a Mac, closing the last window of an app leaves the app running. Add an app to App Behavior and it quits a moment after its last window closes, the way it would on Windows. Opening a new window in that moment keeps it running, and documents with unsaved changes still ask to save.
Command Q sits right next to Command W, so it is easy to quit an app by mistake. For the apps you choose, Command Q, and Command W if you like, can need a short hold with a ring that fills up, a second press, or an extra key. It never gets in the way while a password field has secure input on.
The green button can fill the visible screen instead of opening a new Space, with Option click still going full screen. Clicking the Dock icon of the app already in front can minimize it, hide it or bring its next window forward. You can also stop macOS reordering Spaces by recent use, and drag any window from anywhere while holding a few modifier keys.
Updated

How to make a Mac app quit when its last window closes
- 1
Allow Accessibility
App Behavior sees which button or Dock icon you click and moves windows through Accessibility. It never records what you type.
- 2
Add an app
Pick a running app and choose whether it quits after its last window and how Command Q and Command W are guarded.
- 3
Turn on window fixes
The green button fills the screen without a new Space, and clicking the front app in the Dock minimizes it.
- 4
Grab and move
Hold the modifier keys and drag anywhere in a window to move it, or right drag to resize it.
What it does
Quit on last window
Chosen apps quit soon after their last window closes. Unsaved documents still ask to save.
Quit and close protection
Command Q and Command W need a hold, a second press or an extra key in chosen apps.
Green button fills the screen
The green button fills the visible screen without a new Space. Option click keeps full screen.
Dock clicks
Clicking the Dock icon of the app in front minimizes it, hides it or cycles its windows.
Fixed Spaces order
Stops macOS reordering Spaces by recent use, and puts the old setting back when off.
Grab and move
Hold modifier keys and drag anywhere in a window to move it, or right drag to resize it.
Does macOS do this already?
Can a Mac quit an app when its last window closes?
Not for most apps. macOS keeps apps running after their last window closes unless the developer chose otherwise. App Behavior lets you choose for each app, and adds a grace period so a new window keeps it open.
Use cases
Apps that should quit like on Windows
Add Preview or a chat app and it quits shortly after you close its last window, so it stops sitting in the Dock and using memory.
No more accidental quits
Make Command Q in your browser need a hold, so reaching for Command W never closes every tab again.
Big windows without full screen
Click the green button to fill the screen while keeping the menu bar, the Dock and your other windows one click away.
From the terminal and your coding agents
Every example returns JSON with --json, and agents can call the same thing over MCP.
ed invoke appBehavior appBehavior.status --json '{}'ed invoke appBehavior appBehavior.rules.set --json '{"rule":{"bundleID":"com.example.editor","quitProtection":"hold"}}'ed invoke appBehavior appBehavior.feature --json '{"feature":"greenButton","enabled":true}'ed invoke appBehavior appBehavior.zoom --json '{}'Permissions and requirements
Permissions
- Accessibility, to see which button or Dock icon you click, to move windows and to catch Command Q in the apps you protect. Edith never records what you type.
Requirements
- macOS 14 or later on Apple silicon
- Edith running
Frequently asked questions
Will I lose unsaved work?
No. App Behavior asks the app to quit the normal way, so any document with unsaved changes shows its usual save prompt.
What happens to Spaces when I turn the fixed order off?
The setting goes back to exactly what it was before you turned it on, and the Dock restarts once so macOS picks it up.
Does it work in password fields?
Yes. While secure input is on, Command Q and Command W work exactly as macOS normally handles them.
Can I control it from the terminal?
Yes. ed invoke appBehavior appBehavior.status shows every rule, and appBehavior.rules.set adds or changes a rule for one app.
