当设置wsl为默认终端时,vscode debugger不生效(node)

122 阅读1分钟

从package.json,DebugScripts没反应

原因是vscode如果设置了默认终端是wsl,那调试的时候也会默认使用wsl

image.png

  • 解决方法
"terminal.integrated.profiles.windows": {
    "Command Prompt": {
      "path": [
        "${env:windir}\\Sysnative\\cmd.exe",
        "${env:windir}\\System32\\cmd.exe"
      ],
      "args": [],
      "icon": "terminal-cmd"
    },
    "Ubuntu-20.04 (WSL)": {
      "path": "C:\\WINDOWS\\system32\\wsl.exe",
      "args": ["-d", "Ubuntu"]
    },
    // 其他终端
  },
  "terminal.integrated.defaultProfile.windows": "Command Prompt",// 配置默认终端为Cmd或者power shell