如何让 Code Runner 在外部终端(命令提示符)中运行? [英] How to make Code Runner run in external terminal (Command Prompt)?
问题描述
所以,基本上Visual Studio Code中的Code Runner就可以在集成终端中运行了.怎样才能让它在外部终端运行,是command prompt,因为我需要把我的程序的输出展示给我的同学,所以不方便通过集成的显示出来.
So, basically the Code Runner in Visual Studio Code can run in the integrated terminal. How can I make it to run in external terminal, which is command prompt because I need to present my program's output to my classmates, so it's not convenient to display it through the integrated one.
我知道有一个像 Dev-C++ 这样的软件可以在外部终端中运行,但我喜欢使用这个 VS Code,因为它的 UI 很干净,而且 Code Runner 插件很好地完成了它的工作.我怎样才能一键完成?有什么配置吗?
I know there's a software like Dev-C++ that can run in external terminal, but I love to use this VS Code because of its clean UI, and the Code Runner plugin is pretty good doing its job. How can I do it just with one-click? Is there any configuration?
推荐答案
假设你使用的是 Windows,你需要做的就是在代码中你要运行的 .exe 文件前加上start"命令——runner.executorMap 选项.下面是一个例子:
Supposing that you are using Windows, All you need to do is to put the "start" command before the .exe file you want to run in the code-runner.executorMap option. Here is an example:
"code-runner.executorMap": {
"cpp": "g++ $fullFileName -o $fileNameWithoutExt.exe && start $fileNameWithoutExt.exe"
}
这篇关于如何让 Code Runner 在外部终端(命令提示符)中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!