在执行任务(在本例中为cargo build )时,VSCode终端中会出现以下内容:
> Executing task: cargo build <
(output of the task here)
Terminal will be reused by tasks, press any key to close it.
令人恼火的是,这会使我离开正常的终端,然后我必须获得终端窗口的焦点,然后按一个键返回。当我这样做的时候,cargo build的输出就消失了。
我如何停止这种行为?
如何删除文本的第一行和最后一行?
发布于 2021-06-07 21:03:11
检查VSCode 1.57中的新功能(2021年5月,操作后的2.5年)是否可以提供帮助:
任务presentation
属性有一个新的close
属性。
将close
设置为close
将导致终端在任务退出时关闭。
{ "type":"shell","command":"node build/lib/preLaunch.js","label":“确保重新启动前的依赖项”,"presentation":{“command”:“静默”,"revealProblems":"onProblem","close":true }}
编辑: 18-08-2018在使用关闭选项时,将其切换到Problems选项卡更好,因为这样可以确保任务终端关闭,但问题会正确突出显示。这来自VSCode 1.59.0。
https://stackoverflow.com/questions/47946868
复制相似问题