Skip to content

feat: add vim-style j/k keyboard navigation for approval and question…#1377

Open
IAMLEIzZ wants to merge 1 commit intoMoonshotAI:mainfrom
IAMLEIzZ:feat/vim-keybindings
Open

feat: add vim-style j/k keyboard navigation for approval and question…#1377
IAMLEIzZ wants to merge 1 commit intoMoonshotAI:mainfrom
IAMLEIzZ:feat/vim-keybindings

Conversation

@IAMLEIzZ
Copy link
Copy Markdown

@IAMLEIzZ IAMLEIzZ commented Mar 9, 2026

feat: add vim-style j/k keyboard navigation for approval and question…

Description

This PR adds Vim-style j/k keybindings for navigating approval and question panels in the shell UI. Since many Agent CLI users are Vim users, supporting this feature should make the experience feel more natural and comfortable for them.

Changes:

  • src/kimi_cli/ui/shell/keyboard.py: Added KeyEvent.J and KeyEvent.K for j/k key detection
  • src/kimi_cli/ui/shell/visualize.py: Updated approval panel and question panel to respond to j/k keys for up/down navigation

Behavior:

  • k or : Move selection up
  • j or : Move selection down
  • 1/2/3: Direct selection (unchanged)
  • Enter: Confirm (unchanged)

This allows Vim users to navigate approval/question prompts using familiar keybindings without affecting normal input behavior (j/k only work when the panels are active).

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked the related issue, if any. (N/A for this small UX improvement)
  • I have added tests that prove my fix is effective or that my feature works. (UI keybindings are typically not unit tested; tested manually)
  • I have run make gen-changelog to update the changelog.
  • I have run make gen-docs to update the user documentation.

Open with Devin

Copilot AI review requested due to automatic review settings March 9, 2026 16:15
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Vim-style j/k navigation support to the shell UI’s interactive approval and structured question panels, aligning the terminal UX with common Vim navigation habits.

Changes:

  • Extend KeyEvent to detect j/k key presses in the shell keyboard listener (Unix + Windows).
  • Update shell LiveView keyboard dispatch so approval and question panels treat k as “up” and j as “down”.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/kimi_cli/ui/shell/keyboard.py Adds KeyEvent.J/KeyEvent.K and emits them when j/k are pressed.
src/kimi_cli/ui/shell/visualize.py Handles KeyEvent.J/KeyEvent.K for down/up navigation in question + approval panels.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants