fix(app): terminal serialization bug

This commit is contained in:
Adam
2026-02-03 07:03:25 -06:00
parent e88cbefabe
commit 7508839b70

View File

@@ -241,19 +241,19 @@ class StringSerializeHandler extends BaseSerializeHandler {
protected _rowEnd(row: number, isLastRow: boolean): void { protected _rowEnd(row: number, isLastRow: boolean): void {
let rowSeparator = "" let rowSeparator = ""
if (this._nullCellCount > 0) { const nextLine = isLastRow ? undefined : this._buffer.getLine(row + 1)
const wrapped = !!nextLine?.isWrapped
if (this._nullCellCount > 0 && wrapped) {
this._currentRow += " ".repeat(this._nullCellCount) this._currentRow += " ".repeat(this._nullCellCount)
this._nullCellCount = 0
} }
if (!isLastRow) { this._nullCellCount = 0
const nextLine = this._buffer.getLine(row + 1)
if (!nextLine?.isWrapped) { if (!isLastRow && !wrapped) {
rowSeparator = "\r\n" rowSeparator = "\r\n"
this._lastCursorRow = row + 1 this._lastCursorRow = row + 1
this._lastCursorCol = 0 this._lastCursorCol = 0
}
} }
this._allRows[this._rowIndex] = this._currentRow this._allRows[this._rowIndex] = this._currentRow
@@ -389,7 +389,7 @@ class StringSerializeHandler extends BaseSerializeHandler {
const sgrSeq = this._diffStyle(cell, this._cursorStyle) const sgrSeq = this._diffStyle(cell, this._cursorStyle)
const styleChanged = isEmptyCell ? !equalBg(this._cursorStyle, cell) : sgrSeq.length > 0 const styleChanged = sgrSeq.length > 0
if (styleChanged) { if (styleChanged) {
if (this._nullCellCount > 0) { if (this._nullCellCount > 0) {