/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 分鐘
- 30 天內合併 PR
- 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