warp-notify.sh prints "/dev/tty: Device not configured" when invoked without a controlling TTY

Open Beginner friendly
#38 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bash, shell
Domain
cli

Research direction

Start with scripts/warp-notify.sh, especially the /dev/tty write described as line 21, and reproduce with the provided nohup command using stdin from /dev/null. Done means no stderr warning when no controlling TTY is present, while notification delivery remains unchanged when a writable TTY exists.

Written by the indexing model from the issue text.

Description

Summary

scripts/warp-notify.sh (v2.0.0) writes OSC 777 sequences directly to /dev/tty. When the hook runs in a subprocess that has no controlling terminal — which is common for hooks dispatched by Claude Code (e.g. on Notification, PostToolUse, Stop) — the redirect itself fails before printf's 2>/dev/null can take effect, surfacing as a spurious bash: line 21: /dev/tty: Device not configured in the host UI. Exit code stays 0, so the user only sees the warning.

Reproduction

On macOS, with the plugin enabled and a Warp build that supports OSC 777 (should_use_structured returns true):

nohup bash ~/.claude/plugins/cache/claude-code-warp/warp/2.0.0/scripts/warp-notify.sh "test" "body" </dev/null

→ stderr contains bash: line 21: /dev/tty: Device not configured even though the script otherwise exits 0.

Root cause

> /dev/tty 2>/dev/null only suppresses printf's stderr. The shell-level redirection failure (opening /dev/tty for writing when there is no controlling TTY) is reported on the shell's stderr, before any of the redirections on the printf command apply.

Proposed fix

Guard the write with a writability test. Drop-in replacement for line 21:

if [ -w /dev/tty ]; then
    printf '\033]777;notify;%s;%s\007' "$TITLE" "$BODY" > /dev/tty 2>/dev/null || true
fi

This silences the warning for invocations without a TTY (which legitimately can't deliver the notification anyway) while preserving the existing behaviour when a TTY is present.

Environment

  • macOS 26 (Tahoe), zsh
  • Warp v0.2026.04.29.08.57.stable_01, WARP_CLI_AGENT_PROTOCOL_VERSION=1
  • Plugin claude-code-warp v2.0.0
  • Claude Code (CLI)

Happy to open a PR with the change if useful — let me know.

Dominant language
Shell
Stars
231
Forks
56
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from warpdotdev/claude-code-warp

All issues in warpdotdev/claude-code-warp

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.