From 1e4519976164bd5e379db92611a9e2e29e09ec79 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 26 Dec 2024 11:40:38 +0000 Subject: [PATCH] Treat SOS and PM terminal escape sequences like APC This is a cherry-pick of Stefan Tauner's patch from main, but without my followup refactoring, since the refactoring seemed to me to have a (small but easily avoidable) chance of introducing a bug in 0.83. The only downside of the original patch is that it contains a variable name telling a lie: 'osc_is_apc' should really read 'this isn't an OSC but one of APC, SOS and PM'. But we don't actually treat those three things differently, so the functionality is fine. (cherry picked from commit b6b95f23e563211437e51322edc9118b63a3ca40) --- terminal/terminal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/terminal/terminal.c b/terminal/terminal.c index 2db81c9a..ad309436 100644 --- a/terminal/terminal.c +++ b/terminal/terminal.c @@ -4127,9 +4127,11 @@ static void term_out(Terminal *term, bool called_from_term_data) term->esc_args[0] = 0; term->esc_nargs = 1; break; + case 'X': /* SOS: Start of String */ + case '^': /* PM: privacy message */ case '_': /* APC: application program command */ - /* APC sequences are just a string, terminated by - * ST or (I've observed in practice) ^G. That is, + /* 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 and setting a flag indicating