From f3e443ea4709f94d5a5865d567f5e3647c8cf870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 2 Nov 2024 08:10:25 +0100 Subject: [PATCH] osc: 9: ignore ConEmu/Windows Terminal sequences OSC-9 sequences starting with ";" are now ignored, as they are ConEmu sequences, and not iTerm notifications. --- CHANGELOG.md | 6 ++++++ osc.c | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d37b6e6..d7e9939d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,12 @@ ### Changed + +* OSC-9: sequences beginning with `;` are now ignored. These + sequences are ConEmu/Windows Terminal sequences, and not intended to + be notifications. + + ### Deprecated ### Removed ### Fixed diff --git a/osc.c b/osc.c index 535e29c8..72f3c366 100644 --- a/osc.c +++ b/osc.c @@ -1231,10 +1231,22 @@ osc_dispatch(struct terminal *term) osc_uri(term, string); break; - case 9: + case 9: { /* iTerm2 Growl notifications */ + const char *sep = strchr(string, ';'); + if (sep != NULL) { + errno = 0; + char *end = NULL; + strtoul(string, &end, 10); + if (end == sep && errno == 0) { + /* Ignore ConEmu/Windows Terminal escape */ + break; + } + } + osc_notify(term, string); break; + } case 10: /* fg */ case 11: /* bg */