/cd autocomplete: Enter behavior depends on highlighted-index position; Tab completes text but doesn't select; Escape doesn't dismiss the menu
- 主要言語
- Shell
- スター
- 11.2k
- フォーク
- 1.9k
- 平均マージ
- 14時間 16分
- マージ済み PR(30日)
- 6
説明
## 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.
コントリビューションガイド
調査の方向性
/cd の自動補完メニューとキーボード処理を見つけることから始め、最初の候補とそれ以降の候補に対する Enter、Tab、Escape の動作を再現します。Enter でハイライトされた項目を一貫して確定でき、Tab が選択した規約に従い、Escape で入力を消去する前にメニューを閉じられれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- shell
- 領域
- cli
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 55/100