在 Windows 上的调试控制台中使 Visual Studio 代码使用 WSL/bash

Make Visual Studio Code use WSL/bash in the debug console on Windows

我 运行正在 Visual Studio Windows 上编写代码,但是 运行 我的(NodeJS/TypeScript)应用程序在 WSL/bash 上。但是,我无法让 VS 代码调试控制台使用 bash。好像还是用cmd.exe.

我可以通过 运行 从 Visual Studio 代码中运行我的应用程序,然后在调试控制台中输入 process.platform 来测试它。它显示 win32.

另一方面,终端确实使用bash.exe。

我已将 terminal.integrated.shell.windowsterminal.external.windowsExec 设置为 C:\Windows\System32\bash.exe

如何让 VS Code 在调试控制台中使用 bash?

显然,我提到的设置没有效果。我只需要将 "useWSL": true 设置添加到我的 launch.json.

更新 我已经改用 Remote Development extension for VS Code. I've written about it here.