From 18be346df9252495ed8294b47aa5512745c72322 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 28 Mar 2023 11:35:21 -0700 Subject: [PATCH] Clear line wrapped state on explicit line feed Fixes #4457 See microsoft/vscode#178014 --- src/common/InputHandler.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/common/InputHandler.ts b/src/common/InputHandler.ts index 8b6a480eca..fa65b93bac 100644 --- a/src/common/InputHandler.ts +++ b/src/common/InputHandler.ts @@ -711,6 +711,13 @@ export class InputHandler extends Disposable implements IInputHandler { this._bufferService.scroll(this._eraseAttrData()); } else if (this._activeBuffer.y >= this._bufferService.rows) { this._activeBuffer.y = this._bufferService.rows - 1; + } else { + // There was an explicit line feed (not just a carriage return), so clear the wrapped state of + // the line. This is particularly important on conpty/Windows where revisiting lines to + // reprint is common, especially on resize. Note that the windowsMode wrapped line heuristics + // can mess with this so windowsMode should be disabled, which is recommended on Windows build + // 21376 and above. + this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)!.isWrapped = false; } // If the end of the line is hit, prevent this action from wrapping around to the next line. if (this._activeBuffer.x >= this._bufferService.cols) {