Skip to content

"Debug adapter process has terminated unexpectedly" using integrated terminal (if debugging with Python config everything works) #758

Closed
@weinand

Description

@weinand

From @jcrmatos on December 3, 2017 16:9

  • VSCode Version: Code 1.18.1 (929bacba01ef658b873545e26034d1a8067445e9, 2017-11-16T18:32:36.023Z)
  • OS Version: Windows_NT x64 6.1.7601
  • Extensions:
Extension Author (truncated) Version
vscode-great-icons emm 2.1.20
python ms- 0.8.0

Hello,

When I debug my Python app with the python configuration everything works.
If I try to debug using the Internal terminal it starts to run, showing this command at the terminal

(dexp) C:\Users\JMatos\OneDrive\Python\dexp\dexp>cd c:\Users\JMatos\OneDrive\Python\dexp/dexp && cmd /C "set "PYTHONPATH=C:\Users\JMatos\OneDrive/python/my_modules/my_modules" && set "MYPYPATH=C:\Users\JMatos\OneDrive/python/my_modules/my_modules" && set "PYTHONIOENCODING=UTF-8" && set "PYTHONUNBUFFERED=1" && C:\Users\JMatos\Envs\dexp\Scripts\python.exe C:\Users\JMatos\.vscode\extensions\ms-python.python-0.8.0\pythonFiles\PythonTools\visualstudio_py_launcher.py c:\Users\JMatos\OneDrive\Python\dexp/dexp 58394 34806ad9-833a-4524-8cd6-18ca4aa74f14 WaitOnAbnormalExit,WaitOnNormalExit c:\Users\JMatos\OneDrive\Python\dexp\dexp\dexp.py "

(dexp) C:\Users\JMatos\OneDrive\Python\dexp\dexp>

but then stops with an error showing up in the upper part of VS Code stating "Debug adapter process has terminated unexpectedly", without any helpful message.

How can I check what is the problem? Is there a log file somewhere?

To use venvs I made the following changes:
User settings
"python.venvPath": "~/Envs"

Workspace settings

"settings": {
		"python.pythonPath": "C:\\Users\\JMatos\\Envs\\dexp\\Scripts\\python.exe",
		"terminal.integrated.shellArgs.windows": [
			"/K",
			"set PYTHONPATH=%OneDrive%\\python\\my_modules\\my_modules && set MYPYPATH=%OneDrive%\\python\\my_modules\\my_modules && workon dexp && cd %OneDrive%\\Python\\dexp\\dexp"
		]
	}

launch.json

"configurations": [
        {
            "name": "Python",
            "type": "python",
            "request": "launch",
            "stopOnEntry": true,
            "pythonPath": "${config:python.pythonPath}",
            "program": "${file}",
            "cwd": "${workspaceRoot}/dexp",
            "env": {"PYTHONPATH": "${env:OneDrive}/python/my_modules/my_modules",
                    "MYPYPATH": "${env:OneDrive}/python/my_modules/my_modules"},
            "envFile": "${workspaceRoot}/.env",
            "debugOptions": [
                "WaitOnAbnormalExit",
                "WaitOnNormalExit",
                "RedirectOutput"
            ]
        },

...

        {
            "name": "Python: Terminal (integrated)",
            "type": "python",
            "request": "launch",
            "stopOnEntry": true,
            "pythonPath": "${config:python.pythonPath}",
            "program": "${file}",
            "cwd": "${workspaceRoot}/dexp",
            "console": "integratedTerminal",
            "env": {"PYTHONPATH": "${env:OneDrive}/python/my_modules/my_modules",
                    "MYPYPATH": "${env:OneDrive}/python/my_modules/my_modules"},
            "envFile": "${workspaceRoot}/.env",
            "debugOptions": [
                "WaitOnAbnormalExit",
                "WaitOnNormalExit"
            ]
        },
...

This is a Tk app.

Thanks,

JM

Copied from original issue: microsoft/vscode#39497

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-debuggingarea-terminalbugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from posterwindows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions