Skip to content

Running a file in WSL executes ^C(keyboardInterrupt) before running #24674

Description

@AWH1122

Type: Bug

Behaviour

Running a script in WSL always has a ^C before it. This causes the terminal to become cluttered.

Steps to reproduce:

  1. Press run for a file within wsl
  2. Observe in a bash terminal that ^C will run on its own line before the script is run on the next line.

Diagnostic data

Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

N/A

Extension version: 2024.22.1
VS Code version: Code 1.96.2 (fabdb6a30b49f79a7aba0f2ad9df9b399473380f, 2024-12-19T10:22:47.216Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Remote OS version: Linux x64 5.15.167.4-microsoft-standard-WSL2

  • Python version (& distribution if applicable, e.g. Anaconda): 3.13.0
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
C-mantic tdennis4496.cmantic 0.9.0
C/C++ ms-vscode.cpptools 1.22.11
clangd llvm-vs-code-extensions.vscode-clangd 0.1.33
Data Wrangler ms-toolsai.datawrangler 1.14.0
GitHub Copilot GitHub.copilot 1.254.0
GitHub Copilot Chat GitHub.copilot-chat 0.23.2
IntelliCode VisualStudioExptTeam.vscodeintellicode 1.3.2
IntelliCode API Usage Examples VisualStudioExptTeam.intellicode-api-usage-examples 0.2.9
JavaScript Debugger ms-vscode.js-debug 1.96.0
Jupyter ms-toolsai.jupyter 2024.11.0
Jupyter Cell Tags ms-toolsai.vscode-jupyter-cell-tags 0.1.9
Jupyter Notebook Renderers ms-toolsai.jupyter-renderers 1.0.21
Jupyter Slide Show ms-toolsai.vscode-jupyter-slideshow 0.1.6
Path Intellisense christian-kohler.path-intellisense 2.10.0
Pylance ms-python.vscode-pylance 2024.12.1
Python ms-python.python 2024.22.1
Python Debugger ms-python.debugpy 2024.14.0
Resource Monitor mutantdino.resourcemonitor 1.0.7
Ruff charliermarsh.ruff 2024.56.0
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.10
System Info
Item Value
CPUs AMD Ryzen 9 3900X 12-Core Processor (24 x 3793)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.92GB (16.02GB free)
Process Argv --folder-uri vscode-remote://wsl%2Bubuntu/home/alexh/python --crash-reporter-id 672d1eda-f4ea-4625-a978-6966492cb88b
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 5.15.167.4-microsoft-standard-WSL2
CPUs AMD Ryzen 9 3900X 12-Core Processor (24 x 0)
Memory (System) 15.58GB (12.85GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt551cf:31179979
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupytercf:31046870
nativerepl1:31139838
pythonrstrctxt:31112756
nativeloc2:31192216
cf971741:31144450
iacca1:31171482
notype1:31157159
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530
6074i472:31201624

Activity

  1. eleanorjboyd commented on Jan 6, 2025

    @eleanorjboyd
    Member

    Hi! Can you give more details about how you run this script? Like what button you are using / flow to run it? Thanks

  2. AWH1122 commented on Jan 6, 2025

    @AWH1122
    Author

    I am using 'run python file' from the run button. This is provided by the Python extension.

  3. anthonykim1 commented on Jan 7, 2025

    @anthonykim1

    Thanks for filing this. This would get resolved once I merge #24555 again. Will leave this open.

  4. changed the title [-]Running a file in WSL executes ^C before running[/-] [+]Running a file in WSL executes ^C(keyboardInterrupt) before running[/+] on Jan 7, 2025
  5. added
    bugIssue identified by VS Code Team member as probable bug
    needs PRReady to be worked on
    and removed
    triage-neededNeeds assignment to the proper sub-team
    on Jan 7, 2025
  6. anthonykim1 commented on Feb 24, 2025

    @anthonykim1

    Verification steps:

    1. This is only applicable for Windows, WSL ONLY
    2. Install latest Python extension pre-release on insiders.
    3. Make sure you have Python interpreter 3.13 or higher selected
    4. Try running a Python file in the terminal, make sure you dont see the Keyboard Interrupt show up
  7. AWH1122 commented on Feb 24, 2025

    @AWH1122
    Author

    I thought you would like to know, this fixes the same issue on MacOS too.

  8. anthonykim1 commented on Feb 24, 2025

    @anthonykim1

    Yeap! Alex Hughes (@AWH1122) is correct. This was resolved for MacOS earlier as well :)
    Just wanted to leave this particular issue dedicated for Windows and WSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-terminalbugIssue identified by VS Code Team member as probable bugneeds PRReady to be worked onverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions