From cf6c7b230d040c3803f1044304fddabe9f7dd87e Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Sat, 16 Apr 2022 13:17:14 +0200 Subject: [PATCH] fix(pwsh): count prompt lines correctly resolves #2081 --- src/shell/scripts/omp.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shell/scripts/omp.ps1 b/src/shell/scripts/omp.ps1 index 115110eb..e5e0070c 100644 --- a/src/shell/scripts/omp.ps1 +++ b/src/shell/scripts/omp.ps1 @@ -112,7 +112,7 @@ function global:Initialize-ModuleSupport { $terminalWidth = $Host.UI.RawUI.WindowSize.Width $standardOut = @(Start-Utf8Process $omp "print primary --error=$global:OMP_ERRORCODE --pwd=""$cleanPWD"" --pswd=""$cleanPSWD"" --execution-time=$global:OMP_EXECUTIONTIME --stack-count=$stackCount --config=""$Env:POSH_THEME"" --terminal-width=$terminalWidth") # make sure PSReadLine knows we have a multiline prompt - $extraLines = $standardOut.Count - 1 + $extraLines = ($standardOut | Measure-Object -Line).Lines - 1 if ($extraLines -gt 0) { Set-PSReadlineOption -ExtraPromptLineCount $extraLines }