程序将黑白泄漏到PowerShell控制台上


5

一些程序,如Node Package Manager( npm )和一些任务 grunt 更改我的PowerShell控制台的颜色,并保持这种方式。这是一张图片:

enter image description here

任何人都知道为什么会这样吗?如何让它恢复正常和/或阻止它发生?


您可以使用命令“cls”清除屏幕。
MikeAWood

Answers:


1

毫无疑问,剧本正在改变颜色,以引起你的注意。要放回去,您可以使用以下脚本。或者更好的是,将其添加到您的个人资料中并在需要重置时运行“提示”。

function Prompt
{
    $promptString = "PS " + $(Get-Location) + ">"
    Write-Host $promptString -NoNewline -ForegroundColor White
    return " "
}
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.