warp-notify.sh fails silently: /dev/tty not accessible from Claude Code hook subprocesses
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 68/100
Direzione di ricerca
Ispeziona warp-notify.sh, concentrandoti sul printf esistente verso /dev/tty utilizzato per le notifiche dell’hook. Riproduci un evento PermissionRequest o Stop su macOS, quindi verifica che la ricerca del TTY nell’albero dei processi invii la notifica OSC 777 mantenendo il fallback quando non viene trovato alcun TTY scrivibile.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
The warp-notify.sh script writes OSC 777 escape sequences to /dev/tty, but Claude Code runs hook scripts in subprocesses that are detached from the controlling terminal. This causes a silent failure (/dev/tty: Device not configured), meaning no notifications are ever delivered despite the plugin being correctly installed and enabled.
Steps to Reproduce
- Install the plugin:
/plugin install warp@claude-code-warp - Trigger a
PermissionRequestorStophook event in Claude Code - No Warp notification appears
Root Cause
Claude Code spawns hook scripts in a subprocess context where /dev/tty is not accessible (ENXIO — device not configured). The script's fallback || true suppresses the error, so nothing is logged and the notification silently fails.
The hooks are invoked correctly — verified by adding temporary file logging. The failure is specifically in the printf ... > /dev/tty call inside warp-notify.sh.
Fix
Walk up the process tree from the hook script to find the first ancestor that has a writable TTY, then write the OSC sequence directly to that TTY device (e.g. /dev/ttys006):
FOUND_TTY=""
CHECK_PID=$$
for _ in 1 2 3 4 5; do
CHECK_PID=$(ps -o ppid= -p "$CHECK_PID" 2>/dev/null | tr -d ' ')
[ -z "$CHECK_PID" ] && break
CANDIDATE=$(ps -o tty= -p "$CHECK_PID" 2>/dev/null | tr -d ' ')
if [ -n "$CANDIDATE" ] && [ "$CANDIDATE" != "??" ] && [ -w "/dev/$CANDIDATE" ]; then
FOUND_TTY="/dev/$CANDIDATE"
break
fi
done
if [ -n "$FOUND_TTY" ]; then
printf '\033]777;notify;%s;%s\007' "$TITLE" "$BODY" > "$FOUND_TTY"
else
printf '\033]777;notify;%s;%s\007' "$TITLE" "$BODY" > /dev/tty 2>/dev/null || true
fi
This replacement for the existing printf ... > /dev/tty line in warp-notify.sh fixes all hook notification types on macOS. The original /dev/tty fallback is retained for cases where the process tree walk doesn't find a TTY.
Environment
- macOS 15.4 (Darwin 25.4.0)
- Warp
v0.2026.05.06.15.42.stable_04 - Claude Code with plugin
warp@claude-code-warpv2.0.0
- Lingua principale
- Shell
- Stelle
- 232
- Fork
- 56
- Merge medio
- 4g 15h
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di warpdotdev/claude-code-warp
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
warpdotdev/claude-code-warp#63 · 2 commenti ·
Tutte le issue di warpdotdev/claude-code-warp
Issue simili
-
Erreur dans le documentationApertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
stephrobert/pavois#390 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
Update to 8.1.3Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
-
feat(plugin): /context-guru:status --stats writes the JSON to a temp file and shows only the pathApertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
rossoctl/context-guru#411 ·
I maintainer di solito rispondono entro 1 giorno