diff --git a/README.md b/README.md index 7efdbc7..a5dab05 100644 --- a/README.md +++ b/README.md @@ -53,11 +53,13 @@ The hook calls `notify.sh `, which plays a sound and shows a bann When you click the banner, `stack-nudge.app` uses System Events to raise the exact window that triggered the notification — even if you have multiple Cursor or terminal windows open. Supported apps: -- Cursor, VS Code +- Cursor, VS Code, Zed - iTerm2, Warp, Ghostty, Terminal.app If the target app is already in focus when the notification fires, the banner is suppressed and only the sound plays. +> **Note on Zed:** Zed itself doesn't expose an external hook system, so stack-nudge relies on the agent's hooks (e.g. `~/.claude/settings.json` for Claude Code) firing from inside Zed's integrated terminal. Click-to-focus and frontmost-window suppression are wired up via `TERM_PROGRAM=zed`, which Zed sets automatically. + ### Immediate focus mode If you'd rather have your editor focus automatically — no click needed: diff --git a/notify.sh b/notify.sh index 5a8a626..d726cf5 100755 --- a/notify.sh +++ b/notify.sh @@ -268,6 +268,7 @@ walk_session_chain() { case "$base" in "Code Helper"|"Code Helper (Plugin)"|"Code Helper (Renderer)"|Code|\ "Cursor Helper"|"Cursor Helper (Plugin)"|"Cursor Helper (Renderer)"|Cursor|\ + Zed|zed|\ iTerm2|iTerm|Terminal|Warp|WarpTerminal|ghostty|Ghostty) TERMINAL_PID="$pid"; TERMINAL_APP="$base"; break ;; esac @@ -356,7 +357,8 @@ notify_macos() { local sound="$3" local voice_message="${4:-$message}" - # Detect terminal / editor bundle ID for click-to-focus + # Detect terminal / editor bundle ID for click-to-focus. + # Zed sets TERM_PROGRAM=zed in its integrated terminal as of zed-industries/zed#14213. local bundle_id case "${TERM_PROGRAM}" in vscode) @@ -366,6 +368,7 @@ notify_macos() { bundle_id="com.microsoft.VSCode" fi ;; + zed) bundle_id="dev.zed.Zed" ;; iTerm.app) bundle_id="com.googlecode.iterm2" ;; WarpTerminal) bundle_id="dev.warp.Warp-Stable" ;; ghostty) bundle_id="com.mitchellh.ghostty" ;; @@ -377,6 +380,7 @@ notify_macos() { case "$bundle_id" in com.todesktop.230313mzl4w4u92) process_name="Cursor" ;; com.microsoft.VSCode) process_name="Code" ;; + dev.zed.Zed) process_name="Zed" ;; com.googlecode.iterm2) process_name="iTerm2" ;; dev.warp.Warp-Stable) process_name="Warp" ;; com.mitchellh.ghostty) process_name="Ghostty" ;;