Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Windows Terminal as debug console in VS Code?

I want to use Windows Terminal as my debug console in Visual Studio Code. I don't like VS Code's integrated terminal. How do I do It?

Here is my launch.json file in my python project:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File External Terminal",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": true
        }
    ]
}
like image 973
Alper Akca Avatar asked Oct 30 '25 23:10

Alper Akca


1 Answers

Looking at the docs, set the console field in launch.json to externalTerminal.

Then, to choose the specific external terminal program to use on windows, use the terminal.external.windowsExec setting. Ex.

"terminal.external.windowsExec": "C:\\Windows\\System32\\cmd.exe"

Just replace the cmd.exe path with whatever path your Windows Terminal is installed at. Try "C:\\Users\\{user-name}\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe" or "%LocalAppData%\\Microsoft\\WindowsApps\\wt.exe".


If neither of those work, you could try set Windows Terminal to be the default terminal used on your system, which according to this Microsoft devblog, you can do in three ways:

  • In Windows Settings > Privacy and Security > For developers > Terminal > Choose the default terminal app to hose the user interface for command-line applications > Windows Terminal

  • In Windows Terminal > Settings > Default Terminal Application > Windows Terminal

  • In Powershell Properties > Terminal > Default Terminal Application > Windows Terminal

That devblog is for Windows 11.This page on tenforums.com suggests that the properties page and Windows Terminal settings approach should work starting at Windows 10 build 21390 with Windows Terminal Preview v1.9.1445.0 or higher.

like image 80
starball Avatar answered Nov 01 '25 15:11

starball