refactor(pwsh): print stderr separately

This commit is contained in:
Jan De Dobbeleer 2022-03-30 22:53:24 +02:00 committed by Jan De Dobbeleer
parent d77e824585
commit 61897b78ef

View file

@ -15,7 +15,11 @@ function global:Start-Utf8Process
$StartInfo.CreateNoWindow = $true
$_ = $Process.Start();
$_ = $Process.WaitForExit();
return $Process.StandardOutput.ReadToEnd() + $Process.StandardError.ReadToEnd()
$stderr = $Process.StandardError.ReadToEnd().Trim()
if ($stderr -ne '') {
$Host.UI.WriteErrorLine($stderr)
}
return $Process.StandardOutput.ReadToEnd().Trim()
}
$env:POWERLINE_COMMAND = "oh-my-posh"