Open testlabauto opened 5 months ago
I believe the underlying problem here is that the console is trying to test the code for completeness (i.e. determining whether the statement should be evaluated or the user prompted to enter more lines), but it isn't working because Python is still Starting and therefore not able to accept messages yet.
If you want to reproduce this at a more casual pace, you can use R and add a Sys.sleep(20)
to your .Rprofile
so that R hangs out in Starting for a while.
I think that in this case the code should be queued for execution without performing any checks to see whether it's complete or not. If you manage to run code before startup finishes, you're probably sending it from the editor rather than typing it by hand, so it probably benefits from the statement range provider.
+1 for queuing statements for execution instead of disallowing typing. Most terminals/consoles do that, so disallowing typing can feel quite jarring in my experience.
I just noticed that if you do Cmd+Shift+0 and then very quickly Cmd+Enter, it appears in the console for a moment and is then lost. It might also be related to this issue.
I noticed this because I've been finding myself wanting to do Cmd+Shift+0 -> Cmd+Shift+Enter very quickly to "restart and run all" while developing in Python. That doesn't currently work either.
https://github.com/posit-dev/positron/assets/559360/2b8db06e-649a-4867-99ea-2f13304ba191
Positron Version: 2024.05.0 (Universal) build 1151
Steps to reproduce the issue:
What did you expect to happen?
I would have expected that the code would be queued until the interpreter was started, then executed.
Were there any error messages in the output or Developer Tools console?
I didn't see any error messages. See the attached screenshot for what Positron looks like when this happens.