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
{{ message }}
Repository navigation
KeyboardInterrupt When Running Selection/Line in Python Terminal with 'Shift+Enter' #24422
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.
Ensure that the setting "python.REPL.sendToNativeREPL" is set to false. (This setting leads to the 'Shift+Enter' keyboard shortcut running the Selection/Line in the Python Terminal.)
Open a Python script file (.py) in VS Code.
Highlight a line or selection of code in the editor.
Press Shift+Enter to run the selection or line in the Python Terminal.
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:
The issue occurs consistently when running a selection or line with Shift+Enter with the specified configuration.
The KeyboardInterrupt appears even when the execution continues after the interrupt message.
If the execution starts from a Python terminal, an error message is displayed, but the KeyboardInterrupt does not appear anymore.
The issue can be also triggered by setting a different keyboard shortcut.
Reacted by levibaguley, Lenard Dome, kagudimov, Yin Jeh Ngui, Ahmed Ali, Arsenii Petryk, Rolando Amir Mirabal Hinojosa, etrotta, Phil Solimine, Rodolfo Núñez and 9 more
changed the title [-]Bug: KeyboardInterrupt When Running Selection/Line in Python Terminal with 'Shift+Enter[/-][+]Bug: KeyboardInterrupt When Running Selection/Line in Python Terminal with 'Shift+Enter'[/+]on Oct 4, 2024
changed the title [-]Bug: KeyboardInterrupt When Running Selection/Line in Python Terminal with 'Shift+Enter'[/-][+]KeyboardInterrupt When Running Selection/Line in Python Terminal with 'Shift+Enter'[/+]on Oct 4, 2024
I'm seeing the same thing. I rolled back to 14.1 and it doesn't do that anymore. Click dropdown on "uninstall" to roll back and uncheck "Auto update". I'm planning on coming back here at some point to check if it's been fixed.
Reacted by Andrés H Cardona, Tobias Witter, Lenard Dome, goodnewz, breininger88, mars9595, kagudimov, Yin Jeh Ngui, SitaraWishal, sncmlife and 12 more
Reacted by Tobias Witter, Lenard Dome, Arsenii Petryk, Rodolfo Núñez, Martijn Wehrens and Julio Cesar Contreras Huerta
Hi. Thank you all for your contributions.
Just as it is shown in the video of Andrés H Cardona (@CardonaEA) , the error started me after I disabled the REPL to be executed after the keyboard shortcut SHIFT + ENTER.
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.
I'm seeing the same thing. I rolled back to 14.1 and it doesn't do that anymore. Click dropdown on "uninstall" to roll back and uncheck "Auto update". I'm planning on coming back here at some point to check if it's been fixed.
I see folks have rolled back to 14.1 to workaround the issue.
But is it really required? Yes, the KeyboardInterrupt appears in the console, but is it actually causing a functional issue besides that?
I'm using version v2024.18.0 and yes the KeyboardInterrupt is happening, but other than that the extension appears to work OK.
I'm seeing the same thing. I rolled back to 14.1 and it doesn't do that anymore. Click dropdown on "uninstall" to roll back and uncheck "Auto update". I'm planning on coming back here at some point to check if it's been fixed.
I see folks have rolled back to 14.1 to workaround the issue.
But is it really required? Yes, the KeyboardInterrupt appears in the console, but is it actually causing a functional issue besides that?
I'm using version v2024.18.0 and yes the KeyboardInterrupt is happening, but other than that the extension appears to work OK.
Yes, it is. At least for me.
That KeyboardInterrupt error was stopping my session after a real error or warning. So I was not able to debug my code without losing a lot of time and rerunning everything again and again. So I stopped using the extension and went back to another IDE not based on VSCode.
Thanks everyone for the input here.
Is everyone on Windows? I can't seem to repro on my MacOS ARM machine.
I DO see the keyboard interrupt on my Windows machine though.
Activity
[-]Bug: KeyboardInterrupt When Running Selection/Line in Python Terminal with 'Shift+Enter[/-][+]Bug: KeyboardInterrupt When Running Selection/Line in Python Terminal with 'Shift+Enter'[/+][-]Bug: KeyboardInterrupt When Running Selection/Line in Python Terminal with 'Shift+Enter'[/-][+]KeyboardInterrupt When Running Selection/Line in Python Terminal with 'Shift+Enter'[/+]levibaguley commentedon Oct 5, 2024
I'm seeing the same thing. I rolled back to 14.1 and it doesn't do that anymore. Click dropdown on "uninstall" to roll back and uncheck "Auto update". I'm planning on coming back here at some point to check if it's been fixed.
CardonaEA commentedon Oct 5, 2024
Yes, no issue with v2024.14.1. Thanks.
lenarddome commentedon Oct 7, 2024
I was experiencing the same issue and can confirm that rolling back to previous versions gets rid of it.
nbwosm commentedon Oct 7, 2024
Thanks levibaguley! I had the same issue and this fixed.
breininger88 commentedon Oct 8, 2024
Phew. Same issue and this worked. Thanks!
adsan2 commentedon Oct 24, 2024
Hi. Thank you all for your contributions.
Just as it is shown in the video of Andrés H Cardona (@CardonaEA) , the error started me after I disabled the REPL to be executed after the keyboard shortcut SHIFT + ENTER.
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.
kcerniauskas3 commentedon Nov 1, 2024
Issue remains in v2024.18.0.
jafar-sadiq commentedon Nov 4, 2024
Rolling Back did fix the issue and as KĘSTUTIS ČERNIAUSKAS (@kcerniauskas3) said ; it still remains in v2024.18.0.
dharmatech commentedon Nov 5, 2024
I see folks have rolled back to
14.1to workaround the issue.But is it really required? Yes, the
KeyboardInterruptappears in the console, but is it actually causing a functional issue besides that?I'm using version
v2024.18.0and yes theKeyboardInterruptis happening, but other than that the extension appears to work OK.rodo-nunez commentedon Nov 6, 2024
Yes, it is. At least for me.
That
KeyboardInterrupterror was stopping my session after a real error or warning. So I was not able to debug my code without losing a lot of time and rerunning everything again and again. So I stopped using the extension and went back to another IDE not based on VSCode.anthonykim1 commentedon Nov 6, 2024
Thanks everyone for the input here.
Is everyone on Windows? I can't seem to repro on my MacOS ARM machine.
I DO see the keyboard interrupt on my Windows machine though.
59 remaining items
Fix: Don’t use executeCommand on python sub-shell for windows. (micro…
dbaeumer commentedon Dec 4, 2024
I still see the
KeyboardInterruptdbaeumer commentedon Dec 4, 2024
I guess it needs a new Python extensions.
dbaeumer commentedon Dec 4, 2024
Anthony Kim (@anthonykim1) I will reopen this. Please close again when ready for verification.
dbaeumer commentedon Dec 4, 2024
My fault. Was not on latest insiders.
dbaeumer commentedon Dec 4, 2024
Fix) Prevent keyboard interrupt for Python3.13 REPL non-Windows (#24555)