Support readline shortcuts ctrl-n and ctrl-p as aliases for up and down
Discussed in https://github.com/posit-dev/positron/discussions/6635
Originally posted by wurli March 5, 2025 Fairly straightforward :) For some reason I just can't get used to the arrow keys for this, and I don't think it's possible to add this as a user keymap.
Thank you!
These are two specific readline shortcuts that don't have implementations. See https://github.com/posit-dev/positron/issues/1953 for more general readline keybinding discussion.
I implemented this for macOS in https://github.com/posit-dev/positron/pull/6741. However, supporting other operating systems is tricky because on Linux and Windows, Ctrl P is the shortcut for opening the Palette to browse files (and our tests rely on this keybinding quite a lot, even when focus is in the Console).
Because of the conflict, it might be necessary to add a user setting to opt in to rewiring Ctrl P when in the console, since I think the number of people who will expect Ctrl P to always open the file browser is greater than the number of people who will want config-free readline shortcuts.
This issue is addressed in https://github.com/posit-dev/positron/pull/8101. Users can now bind whatever keyboard shortcuts they like to the Console: Navigate Input History actions:
Console: Navigate Input History Down Console: Navigate Input History Up Console: Navigate Input History Up (Prefix Match)
Verified Fixed
Positron Version(s) : 2025.07.0 build 112
OS Version : Windows_NT x64 10.0.19045 and MacOS Sequoia 15.5
Test scenario(s)
User is able to bind specific keyboard shortcuts to the Console, including Ctrl + N and Ctrl + P.