Fix handling of empty SGR code

Was broken by refactoring to support colons in SGR codes
This commit is contained in:
Kovid Goyal 2017-11-05 10:06:33 +05:30
parent c0114d5e4e
commit 3cb74a25ba
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 0 deletions

View File

@ -482,6 +482,10 @@ parse_sgr(Screen *screen, uint32_t *buf, unsigned int num, unsigned int *params,
}
}
switch(state) {
case START:
params[num_params++] = 0;
SEND_SGR;
break;
case COLOR1:
case COLOR3:
case NORMAL:

View File

@ -133,6 +133,7 @@ class TestParser(BaseTest):
self.ae(s.cursor.bg, 7 << 24 | 8 << 16 | 9 << 8 | 2)
pb('\033[0;2m', *sgr('0 2'))
pb('\033[;2m', *sgr('0 2'))
pb('\033[m', *sgr('0 '))
pb('\033[1;;2m', *sgr('1 0 2'))
pb('\033[38;5;1m', ('select_graphic_rendition', '38 5 1 '))
pb('\033[38;2;1;2;3m', ('select_graphic_rendition', '38 2 1 2 3 '))