Skip to content

fix: map Esc to interrupt and Ctrl+C to graceful quit#267

Merged
serrrfirat merged 3 commits intomainfrom
fix/repl-esc-interrupt
Feb 21, 2026
Merged

fix: map Esc to interrupt and Ctrl+C to graceful quit#267
serrrfirat merged 3 commits intomainfrom
fix/repl-esc-interrupt

Conversation

@serrrfirat
Copy link
Copy Markdown
Collaborator

Summary

  • make Esc interrupt the current operation in the REPL while keeping the session open
  • make Ctrl+C trigger graceful shutdown (/quit) so terminal behavior matches expectations
  • add rustyline custom bindings support and update REPL help text to document esc

Testing

  • cargo check --bin ironclaw
  • cargo build --bin ironclaw
  • cargo test

@github-actions github-actions Bot added scope: dependencies Dependency updates size: S 10-49 changed lines risk: medium Business logic, config, or moderate-risk modules labels Feb 20, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @serrrfirat, 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 interactive REPL experience by distinguishing between interrupting an ongoing operation and gracefully quitting the session. It reconfigures keyboard shortcuts so that Esc provides a non-disruptive interrupt, while Ctrl+C initiates a proper shutdown, aligning terminal behavior with user expectations.

Highlights

  • REPL Interrupt Behavior: The Esc key now interrupts the current REPL operation without closing the session, allowing users to stop ongoing tasks and continue their work.
  • Graceful REPL Shutdown: The Ctrl+C key combination has been reconfigured to trigger a graceful shutdown of the REPL session using the /quit command, aligning with standard terminal expectations.
  • Custom Key Bindings: Enabled rustyline custom bindings to implement the new Esc key behavior, providing more granular control over REPL interactions.
  • Updated Help Text: The REPL help text has been updated to document the new Esc interrupt command, improving user discoverability.
Changelog
  • Cargo.toml
    • Added the custom-bindings feature to the rustyline dependency.
  • src/channels/repl.rs
    • Updated the REPL help message to include Esc as an interrupt command.
    • Imported additional rustyline types required for custom event handling.
    • Introduced EscInterruptHandler struct to manage Esc key events.
    • Initialized an Arc<AtomicBool> to track Esc key presses.
    • Bound the Esc key to the new EscInterruptHandler for custom interrupt logic.
    • Modified the ReadlineError::Interrupted handling to differentiate between Esc (interrupt) and Ctrl+C (quit).
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

@github-actions github-actions Bot added the contributor: experienced 6-19 merged PRs label Feb 20, 2026
Copy link
Copy Markdown
Contributor

@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 correctly implements the desired behavior of mapping the Esc key to an interrupt action and Ctrl+C to a graceful quit in the REPL. This is achieved by enabling and using rustyline's custom key bindings feature. The changes are well-contained and include updates to documentation and help text. I have one minor suggestion to improve code clarity by removing an unused variable.

Comment thread src/channels/repl.rs Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@serrrfirat serrrfirat enabled auto-merge (squash) February 21, 2026 04:44
@serrrfirat serrrfirat merged commit 3d4c647 into main Feb 21, 2026
4 checks passed
@serrrfirat serrrfirat deleted the fix/repl-esc-interrupt branch February 21, 2026 04:46
This was referenced Feb 21, 2026
jaswinder6991 pushed a commit to jaswinder6991/ironclaw that referenced this pull request Feb 26, 2026
* fix: map Esc to interrupt and Ctrl+C to graceful quit

* Apply suggestions from code review

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: Illia Polosukhin <ilblackdragon@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
bkutasi pushed a commit to bkutasi/ironclaw that referenced this pull request Mar 28, 2026
* fix: map Esc to interrupt and Ctrl+C to graceful quit

* Apply suggestions from code review

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: Illia Polosukhin <ilblackdragon@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: experienced 6-19 merged PRs risk: medium Business logic, config, or moderate-risk modules scope: dependencies Dependency updates size: S 10-49 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants