summaryrefslogtreecommitdiffhomepage
path: root/packages/app/src/addons
diff options
context:
space:
mode:
authorAdam <[email protected]>2026-02-03 07:03:25 -0600
committerAdam <[email protected]>2026-02-03 07:03:34 -0600
commit7508839b708844df3b6fc5afec641e3f2beb4f9d (patch)
tree55332d96f78406e05c5f3218b722a26cfd1bd1e9 /packages/app/src/addons
parente88cbefabeba25f90081541fc6e20d403c1bb171 (diff)
downloadopencode-7508839b708844df3b6fc5afec641e3f2beb4f9d.tar.gz
opencode-7508839b708844df3b6fc5afec641e3f2beb4f9d.zip
fix(app): terminal serialization bug
Diffstat (limited to 'packages/app/src/addons')
-rw-r--r--packages/app/src/addons/serialize.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/app/src/addons/serialize.ts b/packages/app/src/addons/serialize.ts
index f65788785..3f0a8fb0a 100644
--- a/packages/app/src/addons/serialize.ts
+++ b/packages/app/src/addons/serialize.ts
@@ -241,19 +241,19 @@ class StringSerializeHandler extends BaseSerializeHandler {
protected _rowEnd(row: number, isLastRow: boolean): void {
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._nullCellCount = 0
}
- if (!isLastRow) {
- const nextLine = this._buffer.getLine(row + 1)
+ this._nullCellCount = 0
- if (!nextLine?.isWrapped) {
- rowSeparator = "\r\n"
- this._lastCursorRow = row + 1
- this._lastCursorCol = 0
- }
+ if (!isLastRow && !wrapped) {
+ rowSeparator = "\r\n"
+ this._lastCursorRow = row + 1
+ this._lastCursorCol = 0
}
this._allRows[this._rowIndex] = this._currentRow
@@ -389,7 +389,7 @@ class StringSerializeHandler extends BaseSerializeHandler {
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 (this._nullCellCount > 0) {