From 92a14e0964ef0d653785559e95b1a70393e73254 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Tue, 18 Sep 2012 09:20:31 +0200 Subject: [PATCH] vte: fix OSC parser to stop on BEL characters No DEC-VT-manual seems to describe this feature, however, nearly all terminal emulators stop parsing OSC strings when receiving a BEL character. So add this to the normal ST character to terminate OSC strings. Many thanks to Ran Benita for reporting and investigating into this. Signed-off-by: David Herrmann --- src/vte.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vte.c b/src/vte.c index 49e4bfb..892a3ec 100644 --- a/src/vte.c +++ b/src/vte.c @@ -2061,7 +2061,8 @@ static void parse_data(struct kmscon_vte *vte, uint32_t raw) return; case STATE_OSC_STRING: switch (raw) { - case 0x00 ... 0x17: + case 0x00 ... 0x06: + case 0x08 ... 0x17: case 0x19: case 0x1c ... 0x1f: do_trans(vte, raw, STATE_NONE, ACTION_IGNORE); @@ -2069,6 +2070,7 @@ static void parse_data(struct kmscon_vte *vte, uint32_t raw) case 0x20 ... 0x7f: do_trans(vte, raw, STATE_NONE, ACTION_OSC_COLLECT); return; + case 0x07: case 0x9c: do_trans(vte, raw, STATE_GROUND, ACTION_NONE); return;