Skip to content

Comments

fix(cli): disable auto-completion on Shift+Tab to preserve mode cycling#19451

Merged
NTaylorMullen merged 2 commits intomainfrom
ntm/fix-shifttab-autocompletion
Feb 18, 2026
Merged

fix(cli): disable auto-completion on Shift+Tab to preserve mode cycling#19451
NTaylorMullen merged 2 commits intomainfrom
ntm/fix-shifttab-autocompletion

Conversation

@NTaylorMullen
Copy link
Collaborator

Summary

Disables auto-completion when Shift+Tab is pressed. Shift+Tab is used to cycle approval modes (Default, Auto-Edit, Plan), and triggering auto-completion simultaneously was disruptive and unintended.

Details

  • Updated defaultKeyBindings for ACCEPT_SUGGESTION and ACCEPT_SUGGESTION_REVERSE_SEARCH to explicitly require shift: false.
  • Updated InputPrompt.tsx ghost text acceptance logic to check !key.shift before accepting.
  • Added comprehensive unit tests in InputPrompt.test.tsx for all completion modes (standard, reverse search, and ghost text) to ensure Shift+Tab is ignored.
  • Regenerated keybindings documentation to reflect the updated default bindings.

Related Issues

Related to the reported bug where Shift+Tab triggers unwanted auto-completion.

How to Validate

  1. Start Gemini CLI.
  2. Type a partial command (e.g., /h).
  3. Press Shift+Tab.
  4. Observe that it cycles the approval mode (e.g., to "Accepting edits") instead of auto-completing to /help.
  5. Run tests: npm test -w @google/gemini-cli -- src/ui/components/InputPrompt.test.tsx

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run

@NTaylorMullen NTaylorMullen requested review from a team as code owners February 18, 2026 17:30
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @NTaylorMullen, 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 addresses an issue where pressing Shift+Tab inadvertently triggered auto-completion in the CLI, conflicting with its intended function of cycling approval modes. The changes ensure that auto-completion is disabled when Shift+Tab is used, preserving the correct behavior for mode cycling and improving the user experience by preventing disruptive interactions.

Highlights

  • Keybinding Configuration: Modified ACCEPT_SUGGESTION and ACCEPT_SUGGESTION_REVERSE_SEARCH keybindings to explicitly require shift: false, preventing auto-completion when Shift is pressed with Tab.
  • Ghost Text Acceptance Logic: Updated the InputPrompt.tsx component to ensure ghost text is not accepted when Shift+Tab is pressed.
  • Unit Testing: Introduced new unit tests in InputPrompt.test.tsx to verify that Shift+Tab does not trigger auto-completion for standard suggestions, reverse search suggestions, or ghost text.
  • Documentation Update: Updated docs/cli/keyboard-shortcuts.md to reflect that Tab for accepting suggestions now explicitly excludes Shift.
Changelog
  • docs/cli/keyboard-shortcuts.md
    • Updated the description for "Accept a suggestion while reverse searching" to specify "Tab (no Shift)"
    • Updated the description for "Accept the inline suggestion" to specify "Tab (no Shift)"
  • packages/cli/src/config/keyBindings.ts
    • Modified the ACCEPT_SUGGESTION_REVERSE_SEARCH command binding to include shift: false
    • Modified the ACCEPT_SUGGESTION command binding to include shift: false for the tab key
  • packages/cli/src/ui/components/InputPrompt.test.tsx
    • Added a test case to verify that auto-completion does not occur on Shift+Tab
    • Added a test case to verify that auto-completion does not occur on Shift+Tab during reverse search
    • Added a test case to verify that ghost text is not accepted on Shift+Tab
  • packages/cli/src/ui/components/InputPrompt.tsx
    • Added a !key.shift condition to the ghost text acceptance logic to prevent acceptance on Shift+Tab
Ignored Files
  • Ignored by pattern: .gemini/** (1)
    • .gemini/commands/strict-development-rules.md
Activity
  • Updated relevant documentation and README
  • Added/updated tests
  • Validated on MacOS
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
Copy link

github-actions bot commented Feb 18, 2026

Size Change: +52 B (0%)

Total Size: 24.5 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 24.5 MB +52 B (0%)
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B

compressed-size-action

@NTaylorMullen NTaylorMullen force-pushed the ntm/fix-shifttab-autocompletion branch from e260d1e to 1591647 Compare February 18, 2026 17:33
Copy link
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 addresses the issue of Shift+Tab unintentionally triggering auto-completion. The changes are well-implemented across the board:

  • The keybindings for ACCEPT_SUGGESTION and ACCEPT_SUGGESTION_REVERSE_SEARCH are correctly updated to exclude Shift+Tab.
  • The separate logic for ghost text acceptance is also correctly modified to ignore Shift+Tab.
  • Comprehensive unit tests have been added to verify the fix in all relevant completion modes (standard, reverse search, and ghost text), ensuring the change is robust.
  • The documentation has been updated to reflect the new behavior.

The fix is thorough and well-executed. I have not found any issues of high or critical severity.

@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Feb 18, 2026
Copy link
Collaborator

@scidomino scidomino left a comment

Choose a reason for hiding this comment

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

Approved, but fix your testing by regenerating the keybinding docs

- Updated key bindings to explicitly require shift: false for suggestion acceptance

- Ensured ghost text acceptance ignores Shift+Tab

- Added unit tests for Shift+Tab completion suppression
@NTaylorMullen NTaylorMullen force-pushed the ntm/fix-shifttab-autocompletion branch from 1dc1b82 to 69ecc9d Compare February 18, 2026 21:53
@NTaylorMullen NTaylorMullen added this pull request to the merge queue Feb 18, 2026
Merged via the queue into main with commit 8910b27 Feb 18, 2026
26 of 27 checks passed
@NTaylorMullen NTaylorMullen deleted the ntm/fix-shifttab-autocompletion branch February 18, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants