osc: 9: ignore ConEmu/Windows Terminal sequences

OSC-9 sequences starting with "<number>;" are now ignored, as they are
ConEmu sequences, and not iTerm notifications.
This commit is contained in:
Daniel Eklöf 2024-11-02 08:10:25 +01:00
parent ab3af2af37
commit f3e443ea47
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 19 additions and 1 deletions

View file

@ -64,6 +64,12 @@
### Changed
* OSC-9: sequences beginning with `<number>;` are now ignored. These
sequences are ConEmu/Windows Terminal sequences, and not intended to
be notifications.
### Deprecated
### Removed
### Fixed

14
osc.c
View file

@ -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 */