diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index ab081b9..11b534f 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -10,7 +10,7 @@ "name": "warp", "description": "Native Warp notifications when Claude completes tasks or needs input", "source": "./plugins/warp", - "version": "2.2.0", + "version": "2.2.1", "category": "productivity", "tags": ["notifications", "terminal", "warp"] }, diff --git a/plugins/warp/.claude-plugin/plugin.json b/plugins/warp/.claude-plugin/plugin.json index 1e29217..15e2ce4 100644 --- a/plugins/warp/.claude-plugin/plugin.json +++ b/plugins/warp/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "warp", "description": "Warp terminal integration for Claude Code - native notifications, and more to come", - "version": "2.2.0", + "version": "2.2.1", "author": { "name": "Warp", "url": "https://warp.dev" diff --git a/plugins/warp/scripts/emit-terminal-sequence.sh b/plugins/warp/scripts/emit-terminal-sequence.sh index b6a83b9..9a46bc8 100644 --- a/plugins/warp/scripts/emit-terminal-sequence.sh +++ b/plugins/warp/scripts/emit-terminal-sequence.sh @@ -45,6 +45,17 @@ _parse_cc_version() { echo "$1" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 } +# Returns 0 if we are running inside Claude Code. +# +# The `terminalSequence` output field is Claude Code-specific. Other harnesses +# run Claude Code-format hooks (Codex, for one, maps hooks/hooks.json onto its +# own event names) but reject unknown keys in hook stdout, so emitting it there +# turns every hook into a user-visible error -- e.g. Codex prints +# "hook returned invalid post-tool-use JSON output" on every tool call. +_is_claude_code() { + [ -n "${CLAUDECODE:-}" ] || [ -n "${CLAUDE_CODE_VERSION:-}" ] +} + # Returns 0 if the running Claude Code version supports terminalSequence. _supports_terminal_sequence() { local raw="${CLAUDE_CODE_VERSION:-}" @@ -82,5 +93,9 @@ emit_terminal_sequence() { if printf '%s' "$seq" > /dev/tty 2>/dev/null; then return 0 fi + + # No tty and no version. Only gamble on terminalSequence when we can still + # tell we are inside Claude Code; every other harness rejects the field. + _is_claude_code || return 0 jq -nc --arg seq "$seq" '{terminalSequence: $seq}' }