方法
首先把默认终端设置为“Windows终端”,也就是WindowsTerminal。

然后将终端设置的“配置文件/默认值->其他设置/高级->关闭行为”的选项改为“从不自动关闭”。

顺便吐槽一下当前的各种终端……有OpenConsole、Windows PowerShell和WindowsTerminal。微软你就不能好好的合并为一个么?!

隐藏终端窗口的方式
新建一个vbs文件,编辑内容为:
createobject("wscript.shell").run "D:\\ConsoleApplication.exe",vbhide
wscript.quit
这样一闪而过也不会有了……