我需要在Visual Studio代码中清除终端的内容。
每次我使用Maven时,终端的输出都会附加到以前的构建中,这让我感到困惑。
我如何清除终端窗口与一些命令或键盘快捷方式?
CLS不起作用;它只隐藏文本。
我需要在Visual Studio代码中清除终端的内容。
每次我使用Maven时,终端的输出都会附加到以前的构建中,这让我感到困惑。
我如何清除终端窗口与一些命令或键盘快捷方式?
CLS不起作用;它只隐藏文本。
当前回答
我正在运行Visual Studio Code的2020年6月更新。我正在寻找一种简单的方法来清除Python脚本中终端输出的历史记录。点击右上方的垃圾桶图标杀死终端,我的Conda环境自动重新激活。
其他回答
试着输入'cls',如果不行,输入'Clear'大写c,没有引号。希望这能有所帮助。
使用Ctrl + K。这将在Visual Studio代码中清理控制台。
每个注释,在VSCode(1.29及以上)的后期版本中,这个快捷方式是缺失的/需要手动创建。
Navigate: File > Preferences > Keyboard Shortcuts search for workbench.action.terminal.clear If it has no mapping or you wish to change the mapping, continue; otherwise note & use the existing mapping Double click on this entry & you'll be prompted for a key binding. Hold CTRL and tap K. Ctrl + K should now be listed. Press enter to save this mapping Right click the entry and select Change when expression. Type terminalFocus then press enter. That's it. Now, when the terminal is in focus and you press Ctrl+K you'll get the behaviour you'd have expected to get from running clear/cls.
我在windows 10机器上使用Visual Studio Code 1.52.1。'cls'或'Clear'不清除终端。
只写
exit
它将关闭终端并按下
ctrl + shift +。”
打开新的终端。
粘贴此命令-
Remove-Item (Get-PSReadlineOption)。HistorySavePath
在你的powershell和启动新的powershell和它发现清除
欲了解更多详情,请查看此链接@ https://www.shellhacks.com/clear-history-powershell/
只需在终端(窗口)中输入'clear'即可 或者ctrl+shift+p和 在MAC上-右键单击