PowerShell“警告:预测‘ListView’被暂时禁用,因为控制台的当前窗口尺寸太小”

sek*_*i92 5 powershell visual-studio-code windows-terminal visual-studio-2022

每次我在VS Code中打开集成终端时,总是出现这样的警告:

警告:预测“ListView”暂时禁用,因为控制台的当前窗口尺寸太小。要使用“ListView”,请确保“WindowWidth”不小于“54”,“WindowHeight”不小于“15”。

为什么会出现这个警告?这是什么意思?我该如何解决这个问题?

小智 -1

$WarningPreference您可以通过将变量的值更改为 来抑制此警告消息"SilentlyContinue"

首先,编辑您的 PowerShell 配置文件脚本。您可以使用$PROFILE变量找到它的位置。

然后添加以下行并保存更改。

$WarningPreference = "SilentlyContinue"
Run Code Online (Sandbox Code Playgroud)

添加后,重新启动 PowerShell 会话或重新加载配置文件。

. $PROFILE
Run Code Online (Sandbox Code Playgroud)