diff --git a/Sharprompt/Internal/OffscreenBuffer.cs b/Sharprompt/Internal/OffscreenBuffer.cs index 673d68e..c852333 100644 --- a/Sharprompt/Internal/OffscreenBuffer.cs +++ b/Sharprompt/Internal/OffscreenBuffer.cs @@ -79,7 +79,18 @@ public void RenderToConsole() var physicalLeft = _pushedCursor.Left % _consoleDriver.BufferWidth; var physicalTop = _pushedCursor.Top + (_pushedCursor.Left / _consoleDriver.BufferWidth); - _consoleDriver.SetCursorPosition(physicalLeft, _cursorBottom - WrittenLineCount + physicalTop); + var consoleTop = _cursorBottom - WrittenLineCount + physicalTop; + if (_pushedCursor.Left > 0 && physicalLeft == 0) + { + _consoleDriver.WriteLine(); + if (consoleTop == _consoleDriver.BufferHeight) + { + _cursorBottom--; + consoleTop--; + } + } + + _consoleDriver.SetCursorPosition(physicalLeft, consoleTop); } }