mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-11-28 15:56:28 +00:00
fix(init): make log messages on pwsh visible again (#2295)
This commit is contained in:
parent
cf9c89ef6b
commit
a24e843ee0
@ -27,6 +27,7 @@ function global:prompt {
|
|||||||
$startInfo = [System.Diagnostics.ProcessStartInfo]::new($Executable);
|
$startInfo = [System.Diagnostics.ProcessStartInfo]::new($Executable);
|
||||||
$startInfo.StandardOutputEncoding = [System.Text.Encoding]::UTF8;
|
$startInfo.StandardOutputEncoding = [System.Text.Encoding]::UTF8;
|
||||||
$startInfo.RedirectStandardOutput = $true;
|
$startInfo.RedirectStandardOutput = $true;
|
||||||
|
$startInfo.RedirectStandardError = $true;
|
||||||
$startInfo.CreateNoWindow = $true;
|
$startInfo.CreateNoWindow = $true;
|
||||||
$startInfo.UseShellExecute = $false;
|
$startInfo.UseShellExecute = $false;
|
||||||
if ($startInfo.ArgumentList.Add) {
|
if ($startInfo.ArgumentList.Add) {
|
||||||
@ -48,7 +49,17 @@ function global:prompt {
|
|||||||
}
|
}
|
||||||
$startInfo.Arguments = $escaped -Join ' ';
|
$startInfo.Arguments = $escaped -Join ' ';
|
||||||
}
|
}
|
||||||
[System.Diagnostics.Process]::Start($startInfo).StandardOutput.ReadToEnd();
|
$process = [System.Diagnostics.Process]::Start($startInfo)
|
||||||
|
|
||||||
|
# stderr isn't displayed with this style of invocation
|
||||||
|
# Manually write it to console
|
||||||
|
$stderr = $process.StandardError.ReadToEnd().Trim()
|
||||||
|
if ($stderr -ne '') {
|
||||||
|
# Write-Error doesn't work here
|
||||||
|
$host.ui.WriteErrorLine($stderr)
|
||||||
|
}
|
||||||
|
|
||||||
|
$process.StandardOutput.ReadToEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
$origDollarQuestion = $global:?
|
$origDollarQuestion = $global:?
|
||||||
|
Loading…
Reference in New Issue
Block a user