Arrow up / down in the R console does not navigate history by code block anymore #15968
|
After selecting a several lines of code and running them with Ctrl+Enter, I expect "Arrow up" and "Arrow down" to show the entire block of code at once in the console. However, it navigates the history statement by statement. This is annoying because if I want to re-execute this block of code in the future, I need to go back to the editor, re-select the code, and re-execute it instead of just going back the history with "Arrow up". Screencast.from.2026-09-06.16-14-25.webmI'm pretty sure this was how it behaved but this changed fairly recently. For reference, RStudio recovers the entire block instead of showing the history statement by statement. I think I saw this mentioned elsewhere but can't find where exactly, which is why I open this as a discussion. Positron Version: 2026.10.0 build 15 |
Replies: 1 comment 2 replies
|
Thanks for the detailed report! You're right that this changed recently. The behavior changed in #15078 (merged in August, first shipped in the 2026.09 release). That PR reworked how code is submitted to the console to improve speed and responsiveness, especially over remote connections. As part of that change, when you run a multi-line selection with Ctrl/Cmd+Enter, Positron now splits the selection into individual statements up front (for R, using the statement boundary information provided by Ark) and executes each statement separately, rather than sending the whole block to the kernel as a single execution, like what we're discussing in #5272. Console input history records one entry per execution, so a side effect of that change is that running a selection now adds one history entry per statement instead of a single entry for the whole block. That's why Arrow up now steps through statement by statement. The per-statement execution is intentional, but the change to history granularity might be argued to be an unintended side effect. We'll discuss what the right behavior should be here (for example, whether consecutive statements from a single submission should be recalled as one history entry, as RStudio does). We'll follow up once we've decided how we want this to work. |
Thanks for the detailed report! You're right that this changed recently. The behavior changed in #15078 (merged in August, first shipped in the 2026.09 release). That PR reworked how code is submitted to the console to improve speed and responsiveness, especially over remote connections. As part of that change, when you run a multi-line selection with Ctrl/Cmd+Enter, Positron now splits the selection into individual statements up front (for R, using the statement boundary information provided by Ark) and executes each statement separately, rather than sending the whole block to the kernel as a single execution, like what we're discussing in #5272.
Console input history records one entry p…