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.