Fix failing test

This commit is contained in:
Kovid Goyal
2025-04-08 13:07:59 +05:30
parent adc9b3f6cf
commit d1938cb060
2 changed files with 2 additions and 2 deletions

View File

@@ -2996,7 +2996,7 @@ screen_request_capabilities(Screen *self, char c, const char *query) {
// SGR
const char *s = cursor_as_sgr(self->cursor);
if (s && s[0]) shape = snprintf(buf, sizeof(buf), "1$r0;%sm", s);
else shape = snprintf(buf, sizeof(buf), "1$r0m");
else shape = snprintf(buf, sizeof(buf), "1$rm");
} else if (strcmp("r", query) == 0) { // DECSTBM
shape = snprintf(buf, sizeof(buf), "1$r%u;%ur", self->margin_top + 1, self->margin_bottom + 1);
} else if (strcmp("*x", query) == 0) { // DECSACE

View File

@@ -536,7 +536,7 @@ class TestParser(BaseTest):
pb('\033P$qm\033\\', ('screen_request_capabilities', ord('$'), 'm'))
self.ae(c.wtcbuf, b'\033P1$rm\033\\')
for sgr in '0;34;102;1;2;3;4 0;38:5:200;58:2:10:11:12'.split():
expected = set(sgr.split(';')) - {'0'}
expected = set(sgr.split(';'))
c.clear()
parse_bytes(s, f'\033[{sgr}m\033P$qm\033\\'.encode('ascii'))
r = c.wtcbuf.decode('ascii').partition('r')[2].partition('m')[0]