3

As I can't give input in the debug console, I'm trying to run the debugger in External terminal in VS Code.

This is the part of launch.json config file for external terminal.

{
            "name": "Python: Terminal (external)",
            "type": "python",
            "request": "launch",
            "stopOnEntry": true,
            "pythonPath": "${config:python.pythonPath}",
            "program": "${file}",
            "cwd": "",
            "console": "externalTerminal",
            "env": {},
            "externalConsole": true,
            "envFile": "${workspaceRoot}/.env",
            "debugOptions": [
                "WaitOnAbnormalExit",
                "WaitOnNormalExit"
            ]
},

I added the "externalConsole": true part as they said here and I tried with or without that statement.

I get this error,

Debug adapter process has terminated unexpectedly

I tried the docs and the IntelliSense in the json file, but I can't understand and get it to work.

1
  • I'm using linux btw, if that helps Commented Dec 7, 2017 at 4:06

3 Answers 3

5

Adding "console": "externalTerminal", to the debug configuration file worked fine on Linux!

Sign up to request clarification or add additional context in comments.

Comments

2

I am using windows, however, this should fix your problem.

"name": "Python: Terminal (external)",
        "type": "python",
        "request": "launch",
        "stopOnEntry": true,
        "pythonPath": "C:/Users/Zac/Anaconda3/python.exe",
        "program": "${file}",
        "cwd": "",
        "console": "externalTerminal",
        "env": {},
        "envFile": "${workspaceFolder}/.env",
        "debugOptions": [
            "RedirectOutput"
        ]
    },

You need to correctly add a path to your python.exe location in the "pythonPath" line.

Also, take out the "WaitOnAbnormalExit" and "WaitOnNormalExit" from "debugOptions" and just use "RedirectOutput". Remove "externalConsole": true from the code.

Everything else should stay the same.

Hope that helps. Cheers.

Comments

-2

Also remember to put correct value for external terminal location in :

terminal.external.windowsExec

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.