1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-12-26 03:27:30 +00:00

fix(powershell): Fix prompt not updating on -nix systems (#728)

Closes #661
This commit is contained in:
David Knaack 2019-12-13 19:44:58 +01:00 committed by Matan Kushner
parent d71373b265
commit b2ebd24506

View File

@ -10,9 +10,9 @@ function global:prompt {
if ($lastCmd = Get-History -Count 1) {
$duration = [math]::Round(($lastCmd.EndExecutionTime - $lastCmd.StartExecutionTime).TotalSeconds)
# & ensures the path is interpreted as something to execute
$out = @(&::STARSHIP:: prompt --status=$lastexitcode --jobs=$jobs --cmd-duration=$duration)
$out = @(&::STARSHIP:: prompt "--path=$PWD" --status=$lastexitcode --jobs=$jobs --cmd-duration=$duration)
} else {
$out = @(&::STARSHIP:: prompt --status=$lastexitcode --jobs=$jobs)
$out = @(&::STARSHIP:: prompt "--path=$PWD" --status=$lastexitcode --jobs=$jobs)
}
# Convert stdout (array of lines) to expected return type string