execute code in R console upon pressing enter #5180
-
Thanks for the awesome editor! If I type code interactively in the R console, pressing enter sometimes starts a new line. I never want this to happen. Instead always want the code to run when I press enter. Is there a setting to change the default behavior? (I prefer the Rstudio default where enter executes and shift-enter starts a new line) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi! The Positron console should work just like the RStudio one in that regard. Could you provide some code example or a video/screencast of this happening? |
Beta Was this translation helpful? Give feedback.
-
Sorry for the delay. Here's a screencast of me typing and then pressing Enter (not Shift + Enter): Not shown but if I force the cursor to the end of the line, by pressing End or using the right arrow, then Enter executes the code as intended. But note that in the screenshot above, where I don't do this, even if the cursor is at the end of the line, Enter will start a new line. If mid-line I press tab to accept a suggestion, then Enter executes the code as intended. This is positron 2024.11.0 build 49 on Ubuntu 24.04. I confirmed the behavior persists if I launch positron with --disable-extensions. |
Beta Was this translation helpful? Give feedback.
Thanks for trying!
Could my problem be related to the setting "Editor: Accept Suggestion on Enter"? I had changed this to "off". Can you reproduce after changing that setting?
When that setting is off, I have the problem in the screencast above: typing
mtcars
then pressing ENTER starts a new line. Though it's not in the screencast, hitting ENTER a second time executes the code.When that setting is on, I have a different problem: if I type
mtcars
, then ENTER "accepts" the suggestion ofmtcars
(which I had already typed anyways). Hitting ENTER a second time executes the code without starting a new line.I'd prefer to just use TAB to accept suggestions and reserve ENTER to execute the code …