terminal: only use bg attr when erasing line

Similar to eraseDisplay semantics, erase line should only apply the bg
attr to erased cells.
This commit is contained in:
Tim Culverhouse
2023-09-25 12:45:01 -05:00
parent 42304ce733
commit 5d598e4e33

View File

@ -1283,10 +1283,15 @@ pub fn eraseLine(
}, },
}; };
const pen: Screen.Cell = if (!self.screen.cursor.pen.attrs.has_bg) .{} else .{
.bg = self.screen.cursor.pen.bg,
.attrs = .{ .has_bg = true },
};
for (start..end) |x| { for (start..end) |x| {
const cell = row.getCellPtr(x); const cell = row.getCellPtr(x);
if (cell.attrs.protected) continue; if (cell.attrs.protected) continue;
cell.* = self.screen.cursor.pen; cell.* = pen;
} }
} }