Notifications via OSC 777 don't work when Claude Code runs hooks in a non-TTY subprocess
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start with warp-notify.sh and its should_use_structured() path, then reproduce a Stop, PromptSubmit, or PostToolUse hook under the non-TTY Claude Code subprocess conditions described. Compare the proposed notification transports and establish which one the project will implement; done means notifications reach Warp from these hooks without relying on the subprocess TTY.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
The Warp plugin for Claude Code sends terminal notifications using OSC 777 escape sequences
(\033]777;notify;...) written directly to /dev/tty. However, Claude Code executes hook scripts as
child subprocesses that are not attached to a TTY — their stdin/stdout/stderr are all
redirected (stdin → /dev/null, stdout/stderr → temp files).
As a result, all notification writes fail silently:
printf '...' > /dev/tty→No such device or address>&2(stderr fallback) → captured by Claude Code harness, never reaches terminal>&1(stdout fallback) → same, captured|| true→ all errors swallowed silently
Reproduction
- Install Warp terminal + Claude Code with the
claude-code-warpplugin - Run any task in Claude Code
- The Stop/PromptSubmit/PostToolUse hooks fire, but no notification appears in Warp
Environment
- Warp:
v0.2026.04.29.08.57.stable_02 WARP_CLI_AGENT_PROTOCOL_VERSION=1WARP_CLIENT_VERSION=v0.2026.04.29.08.57.stable_02- Platform: Windows 11 (WSL/MINGW64)
- Claude Code hook subprocess: stdin→
/dev/null, stdout→temp file, stderr→temp file
Root Cause
Claude Code's hook execution model redirects all FDs of child processes. OSC 777 sequences written by
the hook subprocess cannot reach the Warp terminal because:
- The subprocess has no TTY of its own
- stdout/stderr are piped to Claude Code's internal harness, not to the terminal
Proposed Solutions
Option 1: Warp CLI notification command (recommended)
Provide a warp notify (or similar) CLI command that hook subprocesses can invoke. The CLI
communicates with the Warp terminal via IPC/shared memory to deliver the notification, bypassing the
TTY requirement entirely.
# Instead of:
printf '\033]777;notify;...' > /dev/tty
# Use:
warp notify --title "Task Complete" --body "..."
Option 2: Claude Code host forwards OSC sequences
Claude Code's main process (which IS connected to the Warp terminal via the Warp pipe) could parse
hook subprocess stderr output for OSC 777 sequences and forward them to the terminal.
Option 3: Use Claude Code's built-in notification mechanism
If Claude Code exposes a structured way for hooks to request notifications (e.g., via JSON output with
a notification field), Warp could handle rendering those directly.
Additional Context
The warp-notify.sh script already handles version detection and graceful fallback via
should_use_structured(), so the notification infrastructure is sound — it just needs a transport
mechanism that works from non-TTY subprocesses.
- Ngôn ngữ chính
- Shell
- Star
- 234
- Fork
- 59
- Merge trung bình
- 2 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của warpdotdev/claude-code-warp
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
warpdotdev/claude-code-warp#96 · 2 bình luận ·
-
on-stop.sh slurps the entire transcript with jq -s every turn — ~1 GB RSS on long sessions, triggered a host OOMCó thể đã có người làm @GeiserX đã nhận 24 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
warpdotdev/claude-code-warp#90 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Tất cả issue của warpdotdev/claude-code-warp
Issue tương tự
-
`company import <dir>` drops non-markdown skill files (references/*.json, scripts/*, *.yaml)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
paperclipai/paperclip#18671 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Define the ypass-core error typeĐang mởarea:core
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
julian-hemmer/ypass#4 ·
-
needs-triage
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 62/100
manaflow-ai/cmux#32519 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
mukkund1996/serenity#88 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openwrt/packages#31124 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày