Skip to content

fix(cli): allow perfect match @-path completions to submit on Enter - #19562

Merged
spencer426 merged 2 commits into
mainfrom
fix/directory-completion-ux
Feb 20, 2026
Merged

fix(cli): allow perfect match @-path completions to submit on Enter#19562
spencer426 merged 2 commits into
mainfrom
fix/directory-completion-ux

Conversation

@spencer426

@spencer426 spencer426 commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes a UX bug where directory and file autocompletion was "sticky," requiring users to press Enter twice to submit a prompt even when the input exactly matched a suggestion.

Details

  • Removed the explicit exclusion of CompletionMode.AT from the "perfect match" submission logic in InputPrompt.tsx.
  • Updated InputPrompt.test.tsx to verify that @-paths now submit on Enter when they are a perfect match.

Related Issues

Fixes #19245

How to Validate

  1. Build the project: npm run build
  2. Run the CLI: node packages/cli/dist/index.js
  3. Type a perfect match path like @package.json and press Enter.
    • Expected: The prompt submits immediately.
  4. Type a partial match like @pack and press Enter.
    • Expected: The text autocompletes to @package.json but does NOT submit.

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
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@spencer426
spencer426 requested a review from a team as a code owner February 19, 2026 20:35
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @spencer426, 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 enhances the command-line interface (CLI) user experience by streamlining the autocompletion process for directory and file paths. Previously, users had to press Enter twice even when an autocompleted @-path was a perfect match. This change modifies the input prompt logic to allow immediate submission on a single Enter press for such perfect matches, making the CLI more intuitive and efficient.

Highlights

  • CLI UX Improvement: Resolved a user experience issue where exact matches for directory and file autocompletion (@-paths) in the CLI required two Enter presses to submit.
  • Completion Logic Update: Modified the InputPrompt component to allow @-path perfect matches to submit immediately on a single Enter press.
  • Test Coverage Enhanced: Updated the relevant test suite to confirm the new behavior for @-path perfect match submissions.
  • Build Fix: Addressed a pre-existing type mismatch in a test utility file to ensure the build process functions correctly.
Changelog
  • packages/cli/src/test-utils/render.tsx
    • Fixed a type mismatch in the onRender callback signature.
  • packages/cli/src/ui/components/InputPrompt.test.tsx
    • Updated the test case for @-path perfect matches to assert immediate submission on Enter.
  • packages/cli/src/ui/components/InputPrompt.tsx
    • Removed the explicit exclusion of CompletionMode.AT from the perfect match submission logic.
Activity
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.

Comment thread packages/cli/src/test-utils/render.tsx Outdated

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

The pull request successfully addresses the UX issue where perfect match @-path completions required an extra Enter key press to submit. By removing the explicit exclusion of CompletionMode.AT from the perfect match submission logic in InputPrompt.tsx, the CLI now allows immediate submission when the input exactly matches a file or directory suggestion. The accompanying test updates verify this new behavior, and a build-blocking type mismatch in the test utilities was also resolved. The changes are well-contained and follow the project's established patterns.

@github-actions

github-actions Bot commented Feb 19, 2026

Copy link
Copy Markdown

Size Change: -17 B (0%)

Total Size: 25.2 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 25.2 MB -17 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

@gemini-cli gemini-cli Bot added area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Feb 19, 2026
@scidomino
scidomino added this pull request to the merge queue Feb 20, 2026
@scidomino
scidomino removed this pull request from the merge queue due to a manual request Feb 20, 2026
@spencer426
spencer426 requested review from a team as code owners February 20, 2026 19:16
@spencer426
spencer426 force-pushed the fix/directory-completion-ux branch 2 times, most recently from dc6eb2a to 85cb1de Compare February 20, 2026 19:26
@spencer426
spencer426 force-pushed the fix/directory-completion-ux branch from 85cb1de to 086d560 Compare February 20, 2026 19:28
@spencer426
spencer426 enabled auto-merge February 20, 2026 19:32
@spencer426
spencer426 added this pull request to the merge queue Feb 20, 2026
Merged via the queue into main with commit 239aa09 Feb 20, 2026
27 checks passed
@spencer426
spencer426 deleted the fix/directory-completion-ux branch February 20, 2026 20:03
@sripasg sripasg added the size/m A medium sized PR label Jun 2, 2026
software-0ficial pushed a commit to software-0ficial/gemini-cli that referenced this pull request Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. size/m A medium sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to accept a directory completion to submit a prompt

3 participants