Allow ctrl+n and ctrl+p to navigate between select options

Resolved 💬 4 comments Opened Aug 12, 2025 by Pristor Closed Nov 28, 2025
💡 Likely answer: A maintainer (mattsu2020, contributor) responded on this thread — see the highlighted reply below.

Summary

Currently it is only possible to navigate with the up and down arrow keys in the select menus, for example in the file search, the expected behaviour would be to also be able to use ctrl+n and ctrl+p as it is the case for various other applications.

View original on GitHub ↗

4 Comments

ForSeason · 1 year ago

agree!

mattsu2020 contributor · 12 months ago

agree

Pristor · 11 months ago

I took a look at the code, and this change seems straightforward. I’m open to create a pull request if a team member approves this approach.

Overview

To implement this feature, the only file that needs to change is chat_composer.rs. There are some other active views that could implement this navigation, for example the AuthModeWidget, i would only change the chat_composer.rs in this pull request, but i can also take a look at these other views if that is wanted.

I’d also add three tests for this functionality: one for the slash-command popup navigation, one for the file-search popup, and
one for history navigation. The tests would look roughly like this:

Tests

test_slash_popup_navigation

This is fairly straightforward because the commands follow the order of the SlashCommand enum. I’d create several cases using different Up, Down, and Ctrl+N/Ctrl+P key events, and assert that the correct slash command is selected.

test_file_search_popup_navigation

Insert some file matches into the composer, then verify the navigation by asserting the correct path of the selected item in the file popup.

test_history_navigation

nsert some messages into the composer’s history, then create test cases with different KeyEvent sequences and assert that the composer contains the expected text.

Implementation

The implementation should also be straightforward. Wherever we currently check for KeyEvent::Down/KeyEvent::Up, we can additionally check for KeyEvent { code: KeyCode::Char('n'/'p'), modifiers: KeyModifiers::CONTROL, ... }

I’m not fully sure how to get approval for this proposal, could you help me out @seratch ?

Pristor · 9 months ago

closing this issue since it was implemented in the pr #1994