gemini-cli - ✅(Solved) Fix Enter key unresponsive after selecting a skill from / command dropdown [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#25835Fetched 2026-04-23 07:44:38
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×1labeled ×1

Fix Action

Fix / Workaround

Workaround: Manually delete the last character of the inserted skill name and retype it — after this, Enter works as expected.

PR fix notes

PR #25832: fix: Enter key unresponsive after selecting a skill from / command dropdown

Description (problem / solution / changelog)

Problem

When using the / command in Gemini CLI to invoke a skill, pressing Enter after selecting a skill from the autocomplete dropdown does nothing. The CLI silently ignores the keypress and the skill is never triggered.

Steps to reproduce

  1. Type / in the Gemini CLI prompt — the dropdown shows available skills
  2. Use arrow keys to navigate and select a skill
  3. Press Enter to run the selected skill
ExpectedThe skill executes immediately
ActualEnter does nothing — the skill is never triggered

Workaround: Manually delete the last character of the inserted skill name and retype it — after this, Enter works as expected.


Root Cause

When the user navigates the suggestion dropdown with arrow keys, hasUserNavigatedSuggestions.current is set to true. When Enter is pressed to select a skill, handleAutocomplete inserts the skill name into the buffer — but hasUserNavigatedSuggestions.current was never reset in the default autocomplete code path.

On the subsequent Enter press (intended to execute the skill), the isPerfectMatch fast-path in InputPrompt.tsx evaluates:

   if (
     completion.isPerfectMatch &&
     keyMatchers[Command.SUBMIT](key) &&
     recentUnsafePasteTime === null &&
     (!(completion.showSuggestions && isShellSuggestionsVisible) ||
       (completion.activeSuggestionIndex <= 0 &&
         !hasUserNavigatedSuggestions.current))  // ← still true from arrow-key navigation!
   ) {
     handleSubmit(buffer.text);
   }

Since hasUserNavigatedSuggestions.current was still true, the condition short-circuits to false. Enter falls through to the ACCEPT_SUGGESTION handler, which calls handleAutocomplete again (a no-op since the text is already complete), and the keypress is effectively swallowed.

│ This also explains the workaround: deleting and retyping a character triggers a non-navigation keypress, which resets hasUserNavigatedSuggestions.current = false, allowing the next Enter to work.


Fix

Reset hasUserNavigatedSuggestions.current = false immediately after the default handleAutocomplete call in the ACCEPT_SUGGESTION handler. This mirrors what the shell mode path already does correctly.

                 // Default behavior: auto-complete to prompt box
                 completion.handleAutocomplete(targetIndex);
                 setExpandedSuggestionIndex(-1); // Reset expansion after selection
   +             hasUserNavigatedSuggestions.current = false;

Changed files

  • packages/cli/src/ui/components/InputPrompt.tsx (modified, +1/-0)
RAW_BUFFERClick to expand / collapse

What happened?

Problem

When using the / command in Gemini CLI to invoke a skill, pressing Enter after selecting a skill from the autocomplete dropdown does nothing. The CLI silently ignores the keypress and the skill is never triggered.

Steps to reproduce

  1. Type / in the Gemini CLI prompt — the dropdown shows available skills
  2. Use arrow keys to navigate and select a skill
  3. Press Enter to run the selected skill

Workaround: Manually delete the last character of the inserted skill name and retype it — after this, Enter works as expected.

What did you expect to happen?

ExpectedThe skill executes immediately
ActualEnter does nothing — the skill is never triggered

Client information

│ CLI Version 0.38.2 │ │ Git Commit b0ed611a0 │ │ Model gemini-3.1-pro-preview │ │ Sandbox no sandbox │ │ OS darwin │ │ Auth Method Signed in with Google ([email protected]) │ │ Tier Gemini Code Assist in Google One AI Pro

Login information

No response

Anything else we need to know?

No response

extent analysis

TL;DR

The issue can likely be resolved by modifying the handling of the Enter keypress event in the Gemini CLI to properly trigger the selected skill.

Guidance

  • Investigate the event listener attached to the Enter keypress in the Gemini CLI to ensure it correctly handles the selection from the autocomplete dropdown.
  • Verify that the skill name is correctly inserted into the command line when selected from the dropdown, and that there are no trailing characters that might prevent the skill from triggering.
  • Consider implementing a workaround similar to the manual deletion and retyping of the last character of the skill name to ensure the Enter keypress triggers the skill execution.
  • Review the code changes introduced in recent versions, particularly around the Git Commit b0ed611a0, to identify any potential regressions that might be causing this issue.

Example

No specific code example can be provided without more information on the internal implementation of the Gemini CLI. However, the fix might involve modifying an event listener similar to this:

// Pseudocode example, actual implementation may vary
document.addEventListener('keypress', (e) => {
  if (e.key === 'Enter' && autocompleteDropdown.isSelected) {
    // Ensure the selected skill name is correctly inserted and trimmed
    const skillName = getSelectedSkillName().trim();
    // Trigger the skill execution
    executeSkill(skillName);
  }
});

Notes

The provided workaround suggests that there might be an issue with how the autocomplete dropdown inserts the selected skill name into the command line, potentially leaving a trailing character that prevents the Enter keypress from triggering the skill. The actual fix will depend on the internal implementation of the Gemini CLI.

Recommendation

Apply a workaround that manually trims or corrects the inserted skill name before triggering the skill execution, as the root cause seems related to how the skill name is handled upon selection from the autocomplete dropdown.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING