aboutsummaryrefslogtreecommitdiff
path: root/csi.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2024-07-03 08:53:33 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-07-03 08:53:33 +0000
commit22c8637610e15d2c84509a484fee41bccd0ad0fe (patch)
treed305a2bd3751b546b635c312551650604299a853 /csi.c
parentMerge branch 'color-stack' (diff)
osc: extend damage-cells-by-color to default fg/bg as well
When changing part of the color palette, through either OSC-4, or OSC-10 and OSC-11 (and the corresponding reset OSCs: 104, 110 and 111), only dirty affected cells. We've always done this, but only for OSC-4. This patch breaks out that logic, and extends it to handle default fg/bg too. It also fixes a bug where cells with colored underlines were not dirtied if the underline was the only part of the cell that was affected by a OSC-4 change.
Diffstat (limited to 'csi.c')
-rw-r--r--csi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/csi.c b/csi.c
index 86117c7e..1f61d3ce 100644
--- a/csi.c
+++ b/csi.c
@@ -2098,8 +2098,10 @@ csi_dispatch(struct terminal *term, uint8_t final)
sizeof(term->colors));
term->color_stack.idx = slot - 1;
- /* TODO: we _could_ iterate all cells and only dirty
- those that are affected by the palette change... */
+ /* Assume a full palette switch *will* affect almost
+ all cells. The alternative is to call
+ term_damage_color() for all 256 palette entries
+ *and* the default fg/bg (256 + 2 calls in total) */
term_damage_view(term);
term_damage_margins(term);
} else if (slot == 0) {