mirror of
https://github.com/openai/codex.git
synced 2026-04-24 06:35:50 +00:00
Add vim-style navigation for CLI option selection (#7784)
## Summary Support "j" and "k" keys as aliases for "down" and "up" so vim users feel loved. Only support these keys when the selection is not searchable. ## Testing - env -u NO_COLOR TERM=xterm-256color cargo test -p codex-tui ------ [Codex Task](https://chatgpt.com/codex/tasks/task_i_693771b53bc8833088669060dfac2083)
This commit is contained in:
@@ -284,6 +284,11 @@ impl BottomPaneView for ListSelectionView {
|
||||
modifiers: KeyModifiers::NONE,
|
||||
..
|
||||
} /* ^P */ => self.move_up(),
|
||||
KeyEvent {
|
||||
code: KeyCode::Char('k'),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
..
|
||||
} if !self.is_searchable => self.move_up(),
|
||||
KeyEvent {
|
||||
code: KeyCode::Down,
|
||||
..
|
||||
@@ -298,6 +303,11 @@ impl BottomPaneView for ListSelectionView {
|
||||
modifiers: KeyModifiers::NONE,
|
||||
..
|
||||
} /* ^N */ => self.move_down(),
|
||||
KeyEvent {
|
||||
code: KeyCode::Char('j'),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
..
|
||||
} if !self.is_searchable => self.move_down(),
|
||||
KeyEvent {
|
||||
code: KeyCode::Backspace,
|
||||
..
|
||||
|
||||
Reference in New Issue
Block a user