From 4a64e4aebc7950ae810df67e2e3bd1cbf6b362dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 26 Jan 2020 00:44:53 +0100 Subject: [PATCH] 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" --- vt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vt.c b/vt.c index 4af40789..cb3de1fd 100644 --- a/vt.c +++ b/vt.c @@ -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;