aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2026-06-24 11:03:14 +0000
committerDaniel Eklöf <daniel@ekloef.se>2026-06-24 11:03:14 +0000
commit01b3e7ed9271e49ae571918a912e0783d272abac (patch)
tree1968fe63be7969735d92238093cc88c977e43b54
parentconfig: font_parse(): handle font family names with \-:, (diff)
csi: kitty: limit pop count to the size of the flag stack
It's circular, but there's no need to walk through it more than once... csi: kitty: limit pop count to the size of the flag stack It's circular, but there's no need to walk through it more than once...
-rw-r--r--csi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/csi.c b/csi.c
index a82c0e2c..ed643090 100644
--- a/csi.c
+++ b/csi.c
@@ -1769,10 +1769,10 @@ csi_dispatch(struct terminal *term, uint8_t final)
case '<': {
switch (final) {
case 'u': {
- int count = vt_param_get(term, 0, 1);
+ struct grid *grid = term->grid;
+ int count = min(vt_param_get(term, 0, 1), ALEN(grid->kitty_kbd.flags));
LOG_DBG("kitty kbd: popping %d levels of flags", count);
- struct grid *grid = term->grid;
uint8_t idx = grid->kitty_kbd.idx;
for (int i = 0; i < count; i++) {