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.