# App Behavior

> App Behavior in the Edith ed command line reference. The ed command line

- Canonical URL: https://getedith.pro/docs/cli/app-behavior
- Updated: 2026-12-02

[The `ed` command line](https://getedith.pro/docs/cli)

App Behavior fixes how Mac apps and windows behave, app by app. It has no
command group of its own: every action on its page is an operation of the
running extension, sent with [`ed invoke`](https://getedith.pro/docs/cli/invoke). Each operation
takes a JSON object and prints a JSON object; a rejected request prints a JSON
error on stderr and exits non-zero. Options such as timings live in the tool's
settings and are also available through [`ed config`](https://getedith.pro/docs/cli/config).

```bash
ed extensions enable appBehavior
ed invoke appBehavior appBehavior.status --json '{}'
```

App Behavior needs Accessibility. Without it, every operation still answers,
`status.accessibility` is `false`, and no app or window is changed.

## Operations

| Operation | Input | What it does |
| --- | --- | --- |
| `appBehavior.status` | `{}` | Reports the settings, every app rule, which monitors are running, apps waiting to quit after their last window closed, the Spaces setting and the front app |
| `appBehavior.apps` | `{}` | Adds `apps`: the running apps, by name, that can get a rule |
| `appBehavior.resolve` | `{"bundleID": "..."}` | Adds `resolved`: what applies to that app once its rule and the global settings are combined, and `rule` when it has one |
| `appBehavior.rules.set` | `{"rule": {...}}` | Adds or replaces the rule for one app. A rule with nothing chosen removes it |
| `appBehavior.rules.remove` | `{"bundleID": "..."}` | Removes the rule for one app and returns it in `rule` |
| `appBehavior.feature` | `{"feature": "...", "enabled": true}` | Turns a window fix on or off: `greenButton`, `dockClicks`, `fixedSpaces` or `grab` |
| `appBehavior.dockAction` | `{"dockAction": "..."}` | Sets what clicking the front app's Dock icon does: `minimize`, `hide`, `cycle`, or `off` |
| `appBehavior.zoom` | `{}` | Fills the visible screen with the front window, or puts it back if it already fills it. Adds `zoom`: `filled`, `restored` or `unchanged` |
| `appBehavior.spaces.refresh` | `{}` | Reads the current Spaces setting again into `status.spaces` |
| `appBehavior.permission` | `{}` | Asks macOS for Accessibility |

Every reply holds `status`. A rule looks like this:

```json
{
  "bundleID": "com.example.editor",
  "name": "Editor",
  "quitOnLastWindow": true,
  "quitProtection": "hold",
  "protectClose": true,
  "greenButton": false,
  "dockClick": "hide"
}
```

`quitProtection` is `off`, `hold`, `doublePress` or `modifier`. `protectClose`
also guards Command W and needs a protection mode. `greenButton` and `dockClick`
override the global setting for that app; leave them out to follow it. Missing
fields mean off. Edith itself never gets a rule.

```bash
ed invoke appBehavior appBehavior.rules.set --json '{"rule":{"bundleID":"com.example.editor","quitProtection":"hold"}}'
ed invoke appBehavior appBehavior.resolve --json '{"bundleID":"com.example.editor"}'
ed invoke appBehavior appBehavior.feature --json '{"feature":"greenButton","enabled":true}'
ed invoke appBehavior appBehavior.rules.remove --json '{"bundleID":"com.example.editor"}'
```

## Behavior

- **Quit on last window.** When the last window of an app with
  `quitOnLastWindow` closes, the app quits after the grace period in
  `appBehaviorQuitGrace` (3 seconds by default). A new window in that time keeps
  it running. The app quits the normal way, so unsaved documents still ask to
  save. Finder and other system apps never quit this way.
- **Quit and close protection.** `hold` needs Command Q held for
  `appBehaviorHoldMilliseconds` while a ring fills, `doublePress` needs a second
  press within `appBehaviorDoublePressMilliseconds`, and `modifier` needs the
  extra key in `appBehaviorProtectionModifier` added to Command Q. Nothing is
  changed while secure input is on.
- **Green button.** A click fills the visible screen of the window's display,
  below the menu bar and beside the Dock, without a new Space. A second click
  puts the window back. Option click still goes full screen.
- **Dock clicks.** Clicking the Dock icon of the app already in front runs the
  chosen action. Clicks with a modifier, on another app, or on an app with no
  visible windows are left to the Dock.
- **Fixed Spaces order.** Turning it on saves the current `mru-spaces` value of
  the Dock, sets it to false and restarts the Dock once. Turning it off, turning
  App Behavior off or removing it puts the saved value back, also after a crash.
- **Grab and move.** Hold the keys in `appBehaviorGrabModifier` and drag
  anywhere in a window to move it. Right drag, or add Shift, to resize from the
  nearest edge or corner.

## Get Edith

Edith is a native Mac app for macOS 14 or later on Apple silicon with 100+ extensions, the `ed` command line and an MCP server. $35 once for one Mac, plus $7 for each additional Mac, with no subscription and a 30-day refund.

- [Buy Edith](https://getedith.pro/pricing): $35 once for one Mac, plus $7 for each additional Mac
- [Download Edith](https://getedith.pro/download): the installer, or Homebrew
