英文:
Why does Visual Studio Code shows path before the actual output When using Java
问题
为什么在运行程序时,VSC会显示这个?
英文:
why does vsc show this when running the program
答案1
得分: 1
就像 @Alexander Makarov 所说,这些是执行脚本,VS Code 会显示它们,以便开发者了解这个过程中发生了什么。
从你的截图中,我们可以知道:
-
你正在对一个项目进行调试,这是你的调试脚本执行路径;
-
这个过程使用 jdk-14 作为 Java 版本进行编译,编码风格是 UTF-8;
-
当前项目缓存存储在这个目录中;
-
hello 是当前调试的 .java 文件的名称。
这是 VS Code 提供的默认设置,如果你不喜欢这样,@anurag saxena 也提供了一种方法,另外安装扩展 Code Runner 也是另一个选择。在 settings.json 中添加以下代码:
"code-runner.clearPreviousOutput": true,
"code-runner.showExecutionMessage": false,
然后每次运行代码时,在输出之前就不会有执行脚本了。
英文:
Just like @Alexander Makarov said, these are execution scripts and VS Code displays them to let developers know what's going on during this process.
From your screenshot, we can know:
-
You're debugging a project and this is your debug script execution path;
-
This process uses jdk-14 as java version to compile, and coding style is UTF-8;
-
The current project cache is stored in this directory;
-
hello is the name of current debugging .java file.
This is a default setting provided by VS Code, and if you don't like it, @anurag saxena had provided a way, also installing the extension Code Runner is another choice. Add the following code in settings.json:
"code-runner.clearPreviousOutput": true,
"code-runner.showExecutionMessage": false,
Then every time you run code, there's no execution script before the ouput.
答案2
得分: 0
这是在VS Code中的默认行为,所以要隐藏不必要的信息,你可以按照以下步骤操作:
首先,进入 "偏好设置"(preferences)-> "设置"(settings),然后搜索 (Java › Debug › Settings: Console)。将其设置从默认值更改为 (internalconsole),然后保存。这样就可以在调试控制台上获得不带终端路径的输出。
英文:
That's the default behavior in VS code, so to hide unnecessary info
you can go in
preferences-> settings and search for (Java › Debug › Settings: Console) Change its setting from default to (internalconsole) and that's it. you will get a terminal path free output on debug console
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论