Console up arrow doesn't bring back last command reliably

There seems to be a bug in recent versions of RStudio IDE where the console history (via up arrow) doesn't reliably bring back the last command run. It seems to skip lines sometimes. I can't quite isolate what is happening. It seems that maybe it skip lines that I enter directly into the console versus lines that come from the source pane, but I haven't reproduced the issue carefully enough to know for sure. I do know that it doesn't 100% skip these history lines.

This is happening in Version 2025.04.0-daily+168 (2025.04.0-daily+168), but was also happening in the most recent stable release.

4 Likes

Hi @genec1, I can replicate this issue on 2024.12.0 Build 467

Same issue on 2024.12.0 Build 467

Up arrow seems to be ignoring console inputs, and inserting other commands (maybe ones that caused errors?).

Somewhat useful workaround is to use cntrl + up (cmd + up on Mac) to get the recent history. This brings up recent console input, but it's also including some other commands simultaneously.

I cleared my history and deleted all of the .Rhistory files. Still getting some ghost commands as shown below.

1 Like

This is still going on on:

RStudio 2024.12.1+563 "Kousa Dogwood" Release (27771613951643d8987af2b2fb0c752081a3a853, 2025-02-02) for Ubuntu Jammy
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) rstudio/2024.12.1+563 Chrome/126.0.6478.234 Electron/31.7.7 Safari/537.36, Quarto 1.6.40 (/opt/quarto/bin/quarto)

1 Like

I am having this problem as well, as of today, using 2024.12.1 Build 563.

1 Like

This issue might be related to how RStudio handles command history between the console and source pane. You can try resetting the history by clearing the .Rhistory file (rm .Rhistory in the terminal) and restarting RStudio. Also, check Tools > Global Options > Code > Saving and adjust the history settings. If the issue persists, you may want to report it on the RStudio GitHub issues page with reproducible steps to help the developers debug it.

Same for me on 2024.12.1 Build 563.pro5 . Not sure yet what causes it, but refreshing the browser page temporarily solves the issue.