Skip to content

Fix Claude tmux bypass confirmation#37

Merged
axeldelafosse merged 1 commit intomainfrom
fix/tmux-claude-bypass-confirmation
Mar 25, 2026
Merged

Fix Claude tmux bypass confirmation#37
axeldelafosse merged 1 commit intomainfrom
fix/tmux-claude-bypass-confirmation

Conversation

@axeldelafosse
Copy link
Copy Markdown
Owner

Summary

  • detect the current Claude bypass confirmation menu even when tmux capture wraps prompt text
  • confirm bypass mode by sending Down and Enter as separate tmux key events
  • add tmux regression coverage for wrapped dev prompts, current bypass wording, and bypass launch mode

Testing

  • bun test tests/loop/tmux.test.ts
  • bun run check

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the automated handling of Claude's startup prompts within a tmux environment. The primary goal is to ensure that the system reliably detects and confirms Claude's bypass and development channel prompts, even when text wrapping occurs in the terminal. This improves the stability and user experience when interacting with Claude in automated workflows.

Highlights

  • Improved Claude Bypass Prompt Detection: The system can now detect the Claude bypass confirmation menu even when tmux capture causes the prompt text to wrap across multiple lines.
  • Enhanced Bypass Confirmation Mechanism: Bypass mode is now confirmed by sending 'Down' and 'Enter' as separate tmux key events, with a short delay in between, to improve reliability.
  • Expanded Test Coverage: New regression tests have been added to cover wrapped development prompts, the current bypass wording, and the bypass launch mode, ensuring robustness.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances the handling of Claude prompts within tmux. It introduces new constants for specific prompt strings, refactors the detectClaudePrompt function to be more robust by normalizing pane text and expanding the bypass prompt detection logic. Crucially, it modifies the unblockClaudePane function to introduce a delay between sending 'Down' and 'Enter' keys when confirming the bypass prompt, addressing potential race conditions. New and updated unit tests have been added to cover these changes, including tests for wrapped dev-channel prompts, the updated bypass prompt wording, and the correct command for launching Claude in bypass mode. There is no specific feedback to provide on the code changes.

Comment on lines +755 to +757
deps.sendKeys(pane, ["Down"]);
await deps.sleep(CLAUDE_PROMPT_POLL_DELAY_MS);
deps.sendKeys(pane, ["Enter"]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Separating the sendKeys for "Down" and "Enter" with a sleep call is a crucial improvement. This ensures that the UI has sufficient time to register the "Down" key press and update the selection before the "Enter" key is sent, preventing potential race conditions or incorrect selections in the Claude prompt. This significantly enhances the reliability of the bypass confirmation process.

@axeldelafosse axeldelafosse merged commit 0905e05 into main Mar 25, 2026
2 checks passed
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.

1 participant