claude-code - 💡(How to fix) Fix [Bug] v2.1.119 REPL ignores all submit keystrokes when stdin is a tmux pane [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52812Fetched 2026-04-25 06:20:15
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×5commented ×1

Root Cause

Both report Platform: darwin, Terminal: tmux, Version: 2.1.119 — suggesting a shared root cause in v2.1.119's TUI input handler for tmux environments.

Fix Action

Fix / Workaround

Any automation layered on a tmux-hosted claude REPL is blocked — specifically daemonized /loop scheduling via CronCreate. The only local workarounds are:

  1. Downgrade to a pre-2.1.119 version, or
  2. Replace the tmux wrapper with a direct pty.fork() spawn (architectural change to every headless deployment).

Code Example

# 1. Spawn Claude inside a detached tmux pane
tmux new-session -d -s claude-debug-test -c "$HOME" "exec claude"

# 2. Wait for REPL warmup
sleep 10

# 3. Send literal text + Enter
tmux send-keys -t claude-debug-test -l "hello"
tmux send-keys -t claude-debug-test Enter

# 4. Observe: prompt stays in input buffer, no submission, no response
tmux capture-pane -t claude-debug-test -p | tail -20

# 5. Positive comparison (same binary, no tmux):
python3 -c "import pty; pty.spawn(['claude'])"
# type "hello" + Enter -> submits normally, Claude responds
RAW_BUFFERClick to expand / collapse

Bug Description

Starting with Claude Code v2.1.119 on macOS, the REPL silently refuses every submission keystroke when launched inside a tmux pane — Enter, C-m, C-j, CSI-u, kitty keyboard protocol, bracketed paste, and paste-buffer all produce only newlines in the input buffer and never reach the submission handler. The exact same binary, invoked through a plain python3 -c "import pty; pty.spawn(['claude'])", accepts \r and submits normally. The practical impact is that any daemonized automation that drives the Claude REPL through a tmux session (a common pattern for headless /loop scheduling) is completely broken.

To Reproduce

# 1. Spawn Claude inside a detached tmux pane
tmux new-session -d -s claude-debug-test -c "$HOME" "exec claude"

# 2. Wait for REPL warmup
sleep 10

# 3. Send literal text + Enter
tmux send-keys -t claude-debug-test -l "hello"
tmux send-keys -t claude-debug-test Enter

# 4. Observe: prompt stays in input buffer, no submission, no response
tmux capture-pane -t claude-debug-test -p | tail -20

# 5. Positive comparison (same binary, no tmux):
python3 -c "import pty; pty.spawn(['claude'])"
# type "hello" + Enter -> submits normally, Claude responds

Expected vs Actual

  • Expected: Claude Code REPL submits input on Enter regardless of outer terminal multiplexer.
  • Actual: Enter (and 17 other variants tested) produces only blank newlines in the input buffer; no submission event reaches the input handler.

Experiment Evidence

The failure is tmux-specific, not keystroke-encoding-specific. The table below summarizes 18 submission strategies tested against the exact same claude binary:

VariantResult
tmux Enter (baseline)FAIL — newline
tmux C-mFAIL — newline
tmux C-j / -H 0aFAIL — newline
tmux -H 0dFAIL — newline
tmux Escape+EnterFAIL
tmux M-Enter / S-EnterFAIL
tmux C-d / C-o / C-gFAIL
tmux double Enter (500ms gap)FAIL — two newlines
tmux bracketed paste \e[200~..\e[201~ + EnterFAIL
tmux \e[13u (CSI-u Enter)FAIL
tmux \e[27;1;13~ (modifyOtherKeys)FAIL
tmux kitty push \e[>31u + Enter + popFAIL
tmux set-buffer + paste-buffer + EnterFAIL
tmux w/ TERM=xterm-256color + EnterFAIL
tmux w/ TERM=dumb + EnterFAIL
tmux + script -q /dev/null claude + EnterFAIL
tmux w/ -CC client attached + EnterFAIL
python pty.fork() + \r (no tmux)PASS — Claude responded

The key diagnostic signal: an outer tmux layer makes the input handler refuse all submissions; a direct PTY of the same binary accepts submissions normally. Every encoding variant that tmux can produce was tried — none reach the handler.

Environment

  • Platform: darwin (macOS 26.3.1, build 25D771280a)
  • Terminal: tmux 3.6a
  • Node: v24.7.0
  • Claude Code: 2.1.119 (@anthropic-ai/[email protected])
  • Install path: /opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/bin/claude.exe (Homebrew npm global)

Regression Window

  • Last known good: before 2026-04-24 17:23 UTC+9 — an earlier version submitted normally in the same tmux environment; historical daemon logs show Scheduled <8-hex> cron registrations up to 17:51.
  • First failure: 2026-04-24 18:53 UTC+9 — first daemon-inject-entry.sh FATAL recorded.
  • Binary mtime change matches: claude.exe rewritten at 2026-04-24 17:23:54, aligning precisely with the regression window.

Related Issues

  • #52724[Bug] Config save not triggered on Enter key press (same tmux + 2.1.119 + Enter handling, different screen context)
  • #52728[Bug] Control+C does not interrupt vim mode editor (same tmux + 2.1.119 + key handling)

Both report Platform: darwin, Terminal: tmux, Version: 2.1.119 — suggesting a shared root cause in v2.1.119's TUI input handler for tmux environments.

Impact

Any automation layered on a tmux-hosted claude REPL is blocked — specifically daemonized /loop scheduling via CronCreate. The only local workarounds are:

  1. Downgrade to a pre-2.1.119 version, or
  2. Replace the tmux wrapper with a direct pty.fork() spawn (architectural change to every headless deployment).

Ask

Is this an intentional change (e.g., tighter detection of "scripted" input environments to prevent automation abuse) or a regression?

  • If intentional: please document the supported interfaces for headless automation so downstream tooling can migrate cleanly.
  • If regression: please confirm the offending input-handler change in the v2.1.119 diff and share a timeline for a fix.

Happy to run additional diagnostics (e.g., strace/dtruss input read trace, TTY attribute dumps, or --debug-level logs) if it helps narrow the root cause.

extent analysis

TL;DR

The issue can likely be fixed by downgrading to a pre-2.1.119 version of Claude Code or replacing the tmux wrapper with a direct pty.fork() spawn.

Guidance

  • Investigate the changes made in version 2.1.119 to identify the root cause of the issue, specifically focusing on the TUI input handler for tmux environments.
  • Verify that the issue is indeed tmux-specific by testing the same binary with different terminal multiplexers or without any multiplexer.
  • Consider implementing a temporary workaround, such as downgrading to a pre-2.1.119 version or using a direct pty.fork() spawn, to unblock automation layered on a tmux-hosted claude REPL.
  • Review related issues (#52724 and #52728) to see if they provide any additional insights into the problem.

Example

No code snippet is provided as the issue is more related to the environment and versioning rather than a specific code block.

Notes

The issue seems to be specific to the combination of Claude Code version 2.1.119, tmux, and macOS. The fact that the same binary works normally when spawned directly using pty.fork() suggests that the problem lies in the interaction between Claude Code and tmux.

Recommendation

Apply a workaround, such as downgrading to a pre-2.1.119 version, until a fix is available, as this is a regression that affects critical automation functionality.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] v2.1.119 REPL ignores all submit keystrokes when stdin is a tmux pane [1 comments, 2 participants]