You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In RStudios, when the interpreter detects you have possibly typed incomplete code, the console prompts you + indicating that the code execution is not complete, and to complete the code. To get out of the + when the console detects an incomplete execution, the esc key is helpful to return the console to starting prompt >. However, in Positron, pressing the esc key does not reset the console to the > prompt
Please let me know if there is already an issue, or a feature request already submitted regarding this, I apologize in advance if so, and would be happy to close this issue, in favor of one that is already being followed. :)
Steps to reproduce the issue:
Open Positron and RStudio
In the Positron and Rstudio console typelibrary(tidyverse)
Call any function to prompt console incompletion has been detected (e.g., in Positron and RStudio console, type ggplot() +
Observe Positron and RStudio console detection of incomplete execution with console prompting +
try to press the esc key to reset console to > prompt
Observe difference in behavior (e.g., RStudio console resets to >, while Positron console stays in the + prompt
Expected or desired behavior:
Behavior is expected to be consistent with RStudio, as in, pressing esc key should reset console prompt to >
Were there any error messages in the UI, Output panel, or Developer Tools console?
NA
The text was updated successfully, but these errors were encountered:
We have had previous discussions on this, such as in #5186, but maybe not an issue. To sum up, this is actually on purpose, because Escape is also used to close popups and we have found that people can not-infrequently lose code in the console that they intended to keep by mashing Escape; it's pretty destructive.
You can take a look at the linked discussion for more thoughts, but what you may be looking for is Ctrl+C. Some benefits of this one over Escape is that it is more consistent with terminals, more single purpose, and harder to do by accident.
@juliasilge thank you for your response I appreciate the clarification! would it make sense to include this as a shortcut in the Positron keyboard shortcut guide website to gain more visibility outside the Positron discussions?
It's been pointed out to me that @anbrav0 is specifically raising the issue of how to get out of a continuation prompt, not just any old incomplete code at the console prompt. Setting up Esc to cancel continuation may be an option we want to pursue.
juliasilge
changed the title
Console: Escape behavior when typing incomplete code in Positron console is not the same as escape behavior in RStudios console
Console: should Esc cancel a continuation prompt?
Jan 8, 2025
System details:
Positron and OS details:
Interpreter details: R 4.4.1
Describe the issue:
In RStudios, when the interpreter detects you have possibly typed incomplete code, the console prompts you
+
indicating that the code execution is not complete, and to complete the code. To get out of the+
when the console detects an incomplete execution, theesc
key is helpful to return the console to starting prompt>
. However, in Positron, pressing theesc
key does not reset the console to the>
promptPlease let me know if there is already an issue, or a feature request already submitted regarding this, I apologize in advance if so, and would be happy to close this issue, in favor of one that is already being followed. :)
Steps to reproduce the issue:
library(tidyverse)
ggplot() +
+
esc
key to reset console to>
prompt>
, while Positron console stays in the+
promptExpected or desired behavior:
Behavior is expected to be consistent with RStudio, as in, pressing
esc
key should reset console prompt to>
Were there any error messages in the UI, Output panel, or Developer Tools console?
NA
The text was updated successfully, but these errors were encountered: