sixel: DECGRI (repeat) with a count of 0 should emit a single sixel

This commit is contained in:
Daniel Eklöf 2022-02-03 19:23:43 +01:00
parent 9150507209
commit 9e8d553a21
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 4 additions and 1 deletions

View file

@ -112,7 +112,7 @@
characters (e.g. emojis). characters (e.g. emojis).
* Rendering of CSD borders when `csd.border-width > 0` and desktop * Rendering of CSD borders when `csd.border-width > 0` and desktop
scaling has been enabled. scaling has been enabled.
* Failure to launch when `exec(3):ed with an empty argv. * Failure to launch when `exec(3)`:ed with an empty argv.
* Pasting from the primary clipboard (mouse middle clicking) did not * Pasting from the primary clipboard (mouse middle clicking) did not
reset the scrollback view to the bottom. reset the scrollback view to the bottom.
* Wrong mouse binding triggered when doing two mouse selections in * Wrong mouse binding triggered when doing two mouse selections in
@ -122,6 +122,7 @@
options options
* Sixel: large image resizes (triggered by e.g. large repeat counts in * Sixel: large image resizes (triggered by e.g. large repeat counts in
`DECGRI`) are now truncated instead of ignored. `DECGRI`) are now truncated instead of ignored.
* Sixel: a repeat count of 0 in `DECGRI` now emits a single sixel.
### Security ### Security

View file

@ -1451,6 +1451,8 @@ decgri(struct terminal *term, uint8_t c)
unsigned count = term->sixel.param; unsigned count = term->sixel.param;
if (likely(count > 0)) if (likely(count > 0))
sixel_add_many(term, c - 63, count); sixel_add_many(term, c - 63, count);
else if (unlikely(count == 0))
sixel_add_many(term, c - 63, 1);
term->sixel.state = SIXEL_DECSIXEL; term->sixel.state = SIXEL_DECSIXEL;
break; break;
} }