【问题标题】:Using windows terminal for executing program in vs code使用 windows 终端在 vs 代码中执行程序
【发布时间】:2021-09-21 12:51:33
【问题描述】:

我使用 vscode 来编写和执行我的 C++ 程序,我使用 vscode 中的集成终端来编译和运行程序(使用 coderunner),但我想在每次运行程序时默认在 Windows 终端中运行我的程序在 vscode 中。任何人都可以帮我解决这个问题吗?

【问题讨论】:

    标签: c++ visual-studio-code


    【解决方案1】:

    如果您想更轻松地使用 Windows Terminal,可以open Windows Terminal in quake mode。默认情况下,键绑定是 win+`。如果您愿意,这可以完全避免使用集成终端。

    您也可以使用集成终端到pass your command to Windows Terminal。将ping docs.microsoft.com 替换为您要执行的命令。然后,您可以使用wt.exe 将构建和运行命令发送到 Windows 终端:

    wt ping docs.microsoft.com
    

    或者,您可以配置按下F5 时的调试行为。首先,配置launch.json 以启动您配置的外部终端:

        "console": "externalTerminal",
    

    然后在settings.json中配置VS Code settings为你的操作系统设置外部终端:

        "terminal.external.windowsExec": "wt.exe",
    

    【讨论】:

      猜你喜欢
      • 2022-11-10
      • 2023-02-06
      • 1970-01-01
      • 2023-02-09
      • 1970-01-01
      • 2022-01-25
      • 2020-09-29
      • 2021-08-11
      相关资源
      最近更新 更多