1

I am using vscode on windows, I have changed the default terminal to PowerShell and after that the debugging stopped working. When I start the debugger, it just exists after a second or two without stopping at breakpoints or errors.

My user settings that I've changed:

"terminal.external.windowsExec": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
    "terminal.integrated.defaultProfile.windows": "PowerShell"

and my debug configuration looks like this:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "script",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "cwd": "${workspaceFolder}",
            "console": "integratedTerminal",
            "justMyCode": false
        }
    ]
}

It used to work before, when the default shell was cmd. Does anyone know how to configure debugger such that it works with PS as the default shell?

1 Answer 1

1

Have you set the "console": "externalTerminal"? The VSCode does not support PowerShell as the external terminal when debugging. it is designed only for cmd.

You can try to set the external terminal to windows terminal through "terminal.external.windowsExec": "wt -p cmd cmd",. And when you set it to "terminal.external.windowsExec": "wt -p powershell powershell", you can get the exact problem.

You can refer to this page for more details. And I have submitted an issue on GitHub.

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

4 Comments

Thanks a lot for your answer, and for submitting an issue! The original motivation behind switching to debugging in powershell was to have access to env variables set in the PS profile, but I guess I will stick with cmd for debugging and have a little automation to sync my cmd and powershell profiles
@roman_ka After you switch to cmd, the problem has been solved?
sorry for the late reply, yes, after I reverted the changes I've made it works fine!
In github.com/microsoft/vscode/pull/171093 vscode special cased wt -- so it could be that this is supported now?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.