Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ The hook calls `notify.sh <agent> <event>`, 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:
Expand Down
6 changes: 5 additions & 1 deletion notify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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" ;;
Expand All @@ -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" ;;
Expand Down