diff --git a/terminal/terminal.c b/terminal/terminal.c index 0c52fc6e..981ff6b3 100644 --- a/terminal/terminal.c +++ b/terminal/terminal.c @@ -3240,7 +3240,7 @@ static void do_osc(Terminal *term) } break; default: - /* APC, SOS and PM are recognised as control sequences but + /* DCS, APC, SOS and PM are recognised as control sequences but * ignored. PuTTY implements no support for any of them. */ break; } @@ -4128,10 +4128,11 @@ static void term_out(Terminal *term, bool called_from_term_data) term->esc_args[0] = 0; term->esc_nargs = 1; break; + case 'P': /* DCS: Device Control String */ case 'X': /* SOS: Start of String */ case '^': /* PM: privacy message */ case '_': /* APC: application program command */ - /* SOS, PM, and APC sequences are just a string, terminated + /* DCS, SOS, PM, and APC sequences are just a string, terminated * by ST or (I've observed in practice for APC) ^G. That * is, they have the same termination convention as OSC. So * we handle them by going straight into OSC_STRING state @@ -4139,7 +4140,8 @@ static void term_out(Terminal *term, bool called_from_term_data) * OSC. */ compatibility(OTHER); term->termstate = SEEN_OSC; - term->osc_type = (c == 'X' ? OSCLIKE_SOS : + term->osc_type = (c == 'P' ? OSCLIKE_DCS : + c == 'X' ? OSCLIKE_SOS : c == '^' ? OSCLIKE_PM : OSCLIKE_APC); term->osc_strlen = 0; term->esc_args[0] = 0; diff --git a/terminal/terminal.h b/terminal/terminal.h index 0e7ab771..02967274 100644 --- a/terminal/terminal.h +++ b/terminal/terminal.h @@ -77,8 +77,9 @@ typedef enum { OSCLIKE_OSC, OSCLIKE_OSC_W, OSCLIKE_APC, - OSCLIKE_SOS, + OSCLIKE_DCS, OSCLIKE_PM, + OSCLIKE_SOS, } OscType; struct terminal_tag {