Clear line wrapped state on explicit line feed

Fixes #4457
See microsoft/vscode#178014
This commit is contained in:
Daniel Imms
2023-03-28 11:35:21 -07:00
parent 37297e09ed
commit 18be346df9
+7
View File
@@ -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) {