vt: bug: state machine: csi entry: handle 0x3a/0x3b correctly

0x3a/0x3b are ':' and ';'. These should not only switch to the 'csi
param' state, but also be parsed as a parameter.

This fixes an issue where a multi-parameter escape with the first
parameter omitted was parsed incorrectly - as if the first parameter
wasn't there.

I.e. "\e[;123r" was parsed as "\e[123r"
This commit is contained in:
Daniel Eklöf 2020-01-26 00:44:53 +01:00
parent 16237eccde
commit 4a64e4aebc
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

2
vt.c
View file

@ -606,7 +606,7 @@ state_csi_entry_switch(struct terminal *term, uint8_t data)
case 0x20 ... 0x2f: action_collect(term, data); return STATE_CSI_INTERMEDIATE;
case 0x30 ... 0x39: action_param(term, data); return STATE_CSI_PARAM;
case 0x3a ... 0x3b: return STATE_CSI_PARAM;
case 0x3a ... 0x3b: action_param(term, data); return STATE_CSI_PARAM;
case 0x3c ... 0x3f: action_collect(term, data); return STATE_CSI_PARAM;
case 0x40 ... 0x7e: action_csi_dispatch(term, data); return STATE_GROUND;
case 0x7f: action_ignore(term); return STATE_CSI_ENTRY;