Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rstudio up arrow key does not display the last run command on console

Tags:

r

rstudio

Sorry if this is a duplicate question: Since updating Rstudio, pressing the up arrow key while the cursor is in the console no longer returns the last run command. Sometimes it does, but most of the time it does not. Is there a way to revert to the previous behaviour? I have to keep pressing ctrl + up_key and its not efficient as the cursor goes back to the start of the previous command instead of the end etc quite literally cumbersome

sessioninfo::platform_info()

 setting  value
 version  R version 4.4.2 (2024-10-31 ucrt)
 os       Windows 11 x64 (build 22631)
 system   x86_64, mingw32
 ui       RStudio
 language (EN)
 collate  English_United States.utf8
 ctype    C
 tz       America/Los_Angeles
 date     2025-01-02
 rstudio  2024.12.0+467 Kousa Dogwood (desktop)
like image 652
KU99 Avatar asked Jan 30 '26 06:01

KU99


1 Answers

This is a known bug (see RStudio issue #7945) introduced in 2024.12.0 (Build 467) where the Up/Down arrows no longer reliably walk your console history. It was fixed in the very next point release (2024.12.1+563 “Kousa Dogwood”), so the simplest way to get the old behavior back is to upgrade to RStudio with minimum version of 2024.12.1+563.

I would recommend you to install latest version: https://dailies.rstudio.com/version/2025.04.0+491.pro2/

Once you’re on that release the Up/Down arrows in the console will once again recall the last-executed commands as before.

Temporary keyboard‐shortcut workaround:

If you can’t upgrade right away, you can rebind the Up/Down arrows to history navigation:

  1. In RStudio go to Tools → Modify Keyboard Shortcuts.
  2. In the “Filter…” box type history.
  3. Find Console: Previous Console History and click its “Shortcut” field.
  4. Press the Up ↑ key; click Apply.
  5. Likewise bind Console: Next Console History to Down ↓.
  6. If that leaves your cursor‐motion commands unmapped, search for Console: Move Cursor Up and clear its Up shortcut (so it doesn’t conflict).

After that, plain Up/Down in the console will walk your history list again.

like image 162
Michael Sivolobov Avatar answered Feb 01 '26 18:02

Michael Sivolobov