/cd autocomplete: Enter behavior depends on highlighted-index position; Tab completes text but doesn't select; Escape doesn't dismiss the menu
- Langage dominant
- Shell
- Étoiles
- 11.2k
- Forks
- 1.9k
- Merge moyen
- 14 h 16 min
- PR mergées (30 j)
- 6
Description
## Summary
The `/cd` autocomplete menu has inconsistent and surprising keybindings that make selecting a directory awkward.
## Observed behavior
- **Enter**: accepts the highlighted autocomplete option only if it is NOT the first item in the list. If it is the first item, Enter submits the typed text instead of accepting the suggestion.
- **Tab**: does NOT select/submit the highlighted option. It only fills the input with the completed text (and even then, it strips the leading `/` so you still have to hit Enter afterward).
- **Escape**: does NOT dismiss the autocomplete menu (which is what most CLIs do). It only clears the input text — and even that takes two presses.
## Expected (matching typical shell / IDE conventions)
- **Enter** on a highlighted item: always accept that item, regardless of position
- **Tab**: cycle through suggestions OR accept-and-submit (pick one — both common)
- **Escape**: first press dismisses the autocomplete menu; only if the menu is already closed does it clear input
## Related
- #1105 — `/cd DirName` vs `/cd DirName/` discrepancy
- #3865 — LLM-invocable `cd` tool (separate)
## Why this matters
`/cd` is one of the most-typed slash commands and the keybinding mismatch makes it feel broken every single use.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par localiser le menu de complétion automatique /cd et sa gestion du clavier, puis reproduisez le comportement de Enter, Tab et Escape pour la première suggestion et les suivantes. C’est terminé lorsque Enter accepte systématiquement un élément mis en évidence, que Tab suit une convention choisie et que Escape ferme le menu avant d’effacer la saisie.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- shell
- Domaine
- cli
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 55/100