Skip to content

KeyboardInterrupt When Running Selection/Line in Python Terminal with 'Shift+Enter' #24422

Closed
@CardonaEA

Description

@CardonaEA

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.

  1. 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.)
  2. Open a Python script file (.py) in VS Code.
  3. Highlight a line or selection of code in the editor.
  4. 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.
Screen.Recording.2024-10-04.211253.mp4
Screen.Recording.2024-10-04.211730.mp4

Metadata

Metadata

Assignees

Labels

area-terminalbugIssue identified by VS Code Team member as probable bugverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions