Skip to content

Claude/fix duplicate interactive messages fp kau#6

Merged
JanusMarko merged 3 commits intomainfrom
claude/fix-duplicate-interactive-messages-FpKAU
Mar 4, 2026
Merged

Claude/fix duplicate interactive messages fp kau#6
JanusMarko merged 3 commits intomainfrom
claude/fix-duplicate-interactive-messages-FpKAU

Conversation

@JanusMarko
Copy link
Copy Markdown
Owner

No description provided.

claude added 3 commits March 4, 2026 01:23
Check pane_current_command before sending keys to tmux windows.
If the pane is running a shell (bash, zsh, etc.), Claude Code has
exited and user text must not be forwarded — it would execute as
shell commands.

Guards added to: send_to_window (safety net), text_handler (with
auto-unbind), esc_command, usage_command, and screenshot key-press
callback.

https://claude.ai/code/session_016c4b8ioybZyscNayeY6Y18
When send_to_window detects the pane is running a shell, it now
captures the pane content and looks for:
  - "Stopped ... claude" → sends "fg" (suspended process)
  - "claude --resume <id>" → sends the resume command

Waits up to 3s (fg) or 15s (--resume) for Claude Code to take
over the terminal, then sends the user's original text.

If no resume command is found, the text_handler unbinds the topic
and tells the user to start a new session.

https://claude.ai/code/session_016c4b8ioybZyscNayeY6Y18
…_pane

Reduces tmux subprocess calls from ~120/s to ~21/s with 20 windows by:
- Adding 1-second TTL cache to list_windows() (all callers in the same
  poll cycle share one tmux enumeration instead of N)
- Unifying capture_pane() to always use direct `tmux capture-pane`
  subprocess (plain text mode previously used libtmux which generated
  3-4 tmux round-trips per call)
- Invalidating cache on mutations (create/kill/rename)

https://claude.ai/code/session_016c4b8ioybZyscNayeY6Y18
@JanusMarko JanusMarko merged commit 8a4a0b1 into main Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants