microsoft / microsoft/vscode-python-debugger

Incorrect debugpy command selected in terminal

Open
#931 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
TypeScript
Stars
181
Forks
126
Avg merge
2d 3h
Merged PRs (30d)
3

Description

Before creating a new issue, please check the FAQ to see if your question is answered there.

Notes

We have debugpy python package installed locally and running debugpy in the VSCode terminal selects the local installation instead of the bundled extension wrapper in .vscode-server/extensions/ms-python.debugpy-2025.18.0/bundled/scripts/noConfigScripts/debugpy. This broke since debugpy 1.8.5, which added the debugpy script to the python package. This happens because the extension wrapper path is added to the end of PATH rather than beginning. Can the extension be modified to prepend the bundled path to the front of PATH instead?

Environment data

  • debugpy version: 1.8.16 (run import debugpy; print(debugpy.__version__) if uncertain)
  • OS and version: Red Hat Enterprise Linux 8.10 (Ootpa)
  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.13
  • Using VS Code or Visual Studio: Yes

Actual behavior

In VSCode terminal when we run debugpy <python-filename>. Instead of attaching a debugger, it gives us the help menu.

Expected behavior

Running debugpy <filename> should select the debugy version bundled with the ms-python.debugpy extension and attach the debugger.

Steps to reproduce:

  1. Install Debugpy version 1.8.16 on the system using pip.
  2. Open the project in VSCode
  3. Download the Python Debugger Extension (@id:ms-python.debugpy) V2025.18.0
  4. Try debugging a python file by running debugpy <filename> in VSCode Terminal.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the extension code that adds the bundled path .vscode-server/extensions/ms-python.debugpy-2025.18.0/bundled/scripts/noConfigScripts/debugpy to the VS Code terminal PATH. Reproduce the issue with debugpy 1.8.16 and verify that prepending this path makes debugpy <filename> attach the debugger rather than show the help menu.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript, vscode
Domain
cli, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.