Merge pull request #1519 from afarber/1208-fix-key-conflict

fix: resolve arrow key navigation conflict between history and completion
This commit is contained in:
tanzhenxin 2026-01-19 19:23:22 +08:00 committed by GitHub
commit eed46447da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 79 additions and 23 deletions

View file

@ -122,9 +122,10 @@ export const defaultKeyBindings: KeyBindingConfig = {
// Auto-completion
[Command.ACCEPT_SUGGESTION]: [{ key: 'tab' }, { key: 'return', ctrl: false }],
// Completion navigation (arrow or Ctrl+P/N)
[Command.COMPLETION_UP]: [{ key: 'up' }, { key: 'p', ctrl: true }],
[Command.COMPLETION_DOWN]: [{ key: 'down' }, { key: 'n', ctrl: true }],
// Completion navigation uses only arrow keys
// Ctrl+P/N are reserved for history navigation (HISTORY_UP/DOWN)
[Command.COMPLETION_UP]: [{ key: 'up' }],
[Command.COMPLETION_DOWN]: [{ key: 'down' }],
// Text input
// Must also exclude shift to allow shift+enter for newline