-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyboardInterrupt When Running Selection/Line in Python Terminal with 'Shift+Enter' #24422
Comments
Yes, no issue with v2024.14.1. Thanks. |
I was experiencing the same issue and can confirm that rolling back to previous versions gets rid of it. |
Thanks @levibaguley! I had the same issue and this fixed. |
Phew. Same issue and this worked. Thanks! |
Hi. Thank you all for your contributions. However, even specifying in "Preferences: Open Workplace Settings (JSON)" the setting "python.REPL.sendToNativeREPL" to false, the KeyboardInterrupt still shows up. I don't know if it is related to the issue, but even if I still turn it to false in "Preferences: Open Workplace Settings (JSON)", in the page "Preferences: Open Default Settings (JSON)" (which I cannot edit), the setting "python.REPL.sendToNativeREPL" is still set true. |
Issue remains in v2024.18.0. |
Rolling Back did fix the issue and as @kcerniauskas3 said ; it still remains in v2024.18.0. |
Thanks everyone for the input here. |
Yes, Windows 10 for me |
I see, can folks also give 2024.16.1 a try and see whether it also adds the keyboard interrupt or not? Edit: After restarting extension, and reloading with Python clear cache, I can repro this on 16.1 too 'Python: Clear Cache and Reload' via command palette (cmd/ctrl + shift + p) |
Thanks for this @rodo-nunez This is incredibly helpful! |
Using binary search: v2024.15.2024091801 failed So my guess is that the bug was introduced on v2024.15.2024091301. |
@anthonykim1 also, I was reproducing that using the "Python: Run Selection/Line in Python Terminal" command. I always change it to Ctrl+Enter, to be able to freely choose between "Python: Run Selection/Line in Python Terminal" and "Python: Run Selection/Line in Python REPL" whenever I want. On v2024.15.2024091301, I don't see problems with the REPL, only with the Terminal. But I don't use the REPL that much. |
Ok, thanks to @rodo-nunez I was able to figure out where this is coming from quickly. Its from this PR: https://github.com/microsoft/vscode-python/pull/24078/files For now, the workaround to not get this keyboard interrupt would be going to setting and then disabling shell integration: And Yes! the REPL you mentioned in the editor is our new native REPL. It has intellisense and syntax highlighting, autocomplete so feel free to give it a try :) |
@anthonykim1 I upgraded to Follow-up: After having made these changes, I noticed a modest amount of latency in sending the code to the Python terminal via Shift + Enter and getting executed. I have reverted to |
I'm using version 2024.18.0 and I used the prerelease version, but unfortunately for every line of code I run through the script, I have this issue update: i add this line to my jason settings (workspace jason settings): |
Hi folks, I'm actively working on to resolve this with the PR here: #24418 |
Just to add, I also experienced this issue on a Mac. In addition to the issue with "KeyboardInterrupt" described above, trying to run some of my code through SHIFT+ENTER also made the terminal become unresponsive. Rolling back to Python v2024.14.1 as suggested above solved both issues. My system that showed the issue: VS code version: 1.95.2 |
Just merged #24418 so please give the pre-release of Python version a try starting tomorrow (Beginning November 13th). Let me know if people suffer from problem after trying out tomorrow's pre-release of Python extension. Make sure you reload extension and run Python Clear Cache and reload after you update!
This sounds like a different issue. @Jintram |
Hi @anthonykim1 just tried it and everything seems normal and fine , thanks for that. |
@anthonykim1 : I tried v2024.21.2024111202 (pre-release), there, everything works normal, also my function that caused the terminal unresponsiveness now executes normally. Attached a movie of what happens with Python v2024.20.0. Perhaps the origin is somehow in my code, which is rather untested. As this issue disappeared with the pre-release, I guess I don't open a new issue. Again, thanks for your work fixing this issue in any case! Screen.Recording.2024-11-13.at.10.35.44.mov |
Thanks everyone for testing this.
Interesting, I wonder if same thing happens if you don't highlight anything and use the "smart send" setting (you would just shift+enter on your expression and expect that entire expression or more to get sent over to terminal). I'm glad this went away with the pre-release but please let me know via filing new issue when you start experiencing this with later pre-release or upcoming release towards late november/early december. Thanks |
I have this problem with python 3.13.0 I downgrade to 3.12.7 and fixed everything.
I emphasis that same problem with python 3.13.0 is even with pre-release version of python extension with vscode.
My PC is windows 11, and vscode version is 1.95.2.
Best Regards; Stats9
…________________________________
From: Anthony Kim ***@***.***>
Sent: Wednesday, November 13, 2024 9:28:22 PM
To: microsoft/vscode-python ***@***.***>
Cc: habib ***@***.***>; Comment ***@***.***>
Subject: Re: [microsoft/vscode-python] KeyboardInterrupt When Running Selection/Line in Python Terminal with 'Shift+Enter' (Issue #24422)
Thanks everyone for testing this.
Attached a movie of what happens with Python v2024.20.0.
As you can see there are additional issues with the terminal aside from the keyboard thing, I don't know how to best describe it.
Interesting, I wonder if same thing happens if you don't highlight anything and use the "smart send" setting (you would just shift+enter on your expression and expect that entire expression or more to get sent over to terminal).
I'm glad this went away with the pre-release but please let me know via filing new issue when you start experiencing this with later pre-release or upcoming release towards late november/early december.
You can directly cc me :)
Thanks
—
Reply to this email directly, view it on GitHub<#24422 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A2APK5IODTAGET4Y54GWWJT2AOHL5AVCNFSM6AAAAABRTGDKGKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZUGM2TKNJRGM>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Make sure you test on the latest pre-release for Python extension. @stats9 |
i editted my words, keyboardInterrupt is fixed with pre-release version of python when using python 3.13.0 or older versions, but image1 for python 3.13.0:image2 for python 3.12.7: |
Environment:
Operating System: Windows 11
VS Code Version: 1.94.0
Python Extension Version: v2024.16.0
Steps to reproduce:
Default setting: the 'shift+enter' keyboard shortcut Runs Selection/Line in Python REPL.
Expected Behavior:
The selected line or code executes in the Python Terminal without any interruptions or errors.
Actual Behavior:
A KeyboardInterrupt is outputted before the selection or line continues executing in the Python Terminal.
Additional Information:
Screen.Recording.2024-10-04.211253.mp4
Screen.Recording.2024-10-04.211730.mp4
The text was updated successfully, but these errors were encountered: