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
Description
When running Python code that requires blocking input (e.g., input()) for the first time in a new shell, VS Code triggers an unexpected KeyboardInterrupt.
This issue only occurs inside a Python virtual environment (venv).
Running the same code a second time (and any subsequent times) works normally.
This behavior does not occur when using the system Python interpreter.
I am using the default "python" debug configuration provided by VS Code.
Steps to Reproduce
Open VS Code.
Create or activate a Python venv.
Run a simple blocking script, for example:
input("Enter something: ")
Observe that VS Code immediately raises a KeyboardInterrupt on the first run.
Run the same script again in the same shell.
The script works normally without interruption.
Expected Behavior
The script should wait for user input normally on the first run, just like it does on subsequent runs.
Actual Behavior
On the first execution in a new shell:
The program is interrupted automatically.
A KeyboardInterrupt is raised without any user action.
On second and later executions:
The script behaves normally and waits for input.
Additional Notes
The issue only appears when using a virtual environment.
The issue does not occur with the system Python interpreter.
I am using the default "python" launch configuration generated by VS Code.
ScreenShot_2026-01-09_04-46-44.mp4
Environment:
VS Code version: 1.108.0
Python extension version: 2025.21.2026010601
Operating System: Windows 11 25H2 26200.7462
Python version: python 3.14.2
Virtual environment type: venv
Shell used: PowerShell
Extension version: 2025.21.2026010601
VS Code version: Code 1.108.0 (94e8ae2b28cb5cc932b86e1070569c4463565c37, 2026-01-08T13:53:10.781Z)
OS version: Windows_NT x64 10.0.26200
Modes:
Python version (& distribution if applicable, e.g. Anaconda): 3.14.2
Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): System
Value of the python.languageServer setting: Default
Type: Bug
Description
When running Python code that requires blocking input (e.g., input()) for the first time in a new shell, VS Code triggers an unexpected KeyboardInterrupt.
This issue only occurs inside a Python virtual environment (venv).
Running the same code a second time (and any subsequent times) works normally.
This behavior does not occur when using the system Python interpreter.
I am using the default "python" debug configuration provided by VS Code.
Steps to Reproduce
Open VS Code.
Create or activate a Python venv.
Run a simple blocking script, for example:
input("Enter something: ")
Observe that VS Code immediately raises a KeyboardInterrupt on the first run.
Run the same script again in the same shell.
The script works normally without interruption.
Expected Behavior
The script should wait for user input normally on the first run, just like it does on subsequent runs.
Actual Behavior
On the first execution in a new shell:
The program is interrupted automatically.
A KeyboardInterrupt is raised without any user action.
On second and later executions:
The script behaves normally and waits for input.
Additional Notes
The issue only appears when using a virtual environment.
The issue does not occur with the system Python interpreter.
I am using the default "python" launch configuration generated by VS Code.
ScreenShot_2026-01-09_04-46-44.mp4
Environment:
VS Code version: 1.108.0
Python extension version: 2025.21.2026010601
Operating System: Windows 11 25H2 26200.7462
Python version: python 3.14.2
Virtual environment type: venv
Shell used: PowerShell
Extension version: 2025.21.2026010601
VS Code version: Code 1.108.0 (94e8ae2b28cb5cc932b86e1070569c4463565c37, 2026-01-08T13:53:10.781Z)
OS version: Windows_NT x64 10.0.26200
Modes:
python.languageServersetting: DefaultUser Settings
Installed Extensions
System Info
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
A/B Experiments