diff --git a/src/Microsoft.PowerShell.PSReadLine/ReadLine.cs b/src/Microsoft.PowerShell.PSReadLine/ReadLine.cs index 609a319585..9c56bf9281 100644 --- a/src/Microsoft.PowerShell.PSReadLine/ReadLine.cs +++ b/src/Microsoft.PowerShell.PSReadLine/ReadLine.cs @@ -557,13 +557,18 @@ namespace Microsoft.PowerShell _visualSelectionCommandCount = 0; _statusIsErrorMessage = false; - _consoleBuffer = ReadBufferLines(_initialY, 1 + Options.ExtraPromptLineCount); + #if UNIX // TODO: not necessary if ReadBufferLines worked, or if rendering worked on spans instead of complete lines string newPrompt = GetPrompt(); + var bufferLineCount = (newPrompt.Length) / (_console.BufferWidth) + 1; + _consoleBuffer = ReadBufferLines(_initialY, bufferLineCount); + for (int i=0; i