posit-dev / positron

Positron, a next-generation data science IDE
https://positron.posit.co
Other
2.77k stars 84 forks source link

Statement range executions currently aren't considered as `input_reply`s, is that right? #4802

Open DavisVaughan opened 1 month ago

DavisVaughan commented 1 month ago

Check out this RStudio behavior where if we send input to the console from an editor with Cmd + Enter, then that input is used when we are in a readline() prompt:

https://github.com/user-attachments/assets/60578f31-c180-4c0f-95d4-0e538a953cab

Compare that with Positron, where instead the input is sent into a queue that only runs after the user manually types something into the Console

https://github.com/user-attachments/assets/f3f1c897-9e8a-43c7-9084-01381fbd6ff3

This briefly surprised me when creating this reprex. I had all the aaaaas in the editor and sent them to the console with cmd+enter. https://github.com/posit-dev/ark/pull/536#discussion_r1773822974

Admittedly I never do this in practice, and could see an argument for requiring an "input reply" to be actual user input physically typed into the console (meaning there would not be a bug here). If that's the case, I think we should add a test for this case to prove to our future selves that we have thought about this behavior.

lionel- commented 1 month ago

We could argue that it's a good property for Cmd+A Cmd+Enter to be equivalent to repeatedly doing Cmd+Enter over the entire file. That would provide a justification for the current behaviour.