mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
osc: kitty: update 's' to the latest spec
* The spec now defines a couple of "standard" names. Translate these to the freedesktop compliant names. * The query response no longer contains 'xdg-names', but instead list the supported standard names.
This commit is contained in:
parent
481ce82d66
commit
ee9c76ded0
1 changed files with 17 additions and 1 deletions
18
osc.c
18
osc.c
|
|
@ -740,7 +740,7 @@ kitty_notification(struct terminal *term, char *string)
|
|||
char reply[128];
|
||||
int n = xsnprintf(
|
||||
reply, sizeof(reply),
|
||||
"\033]99;i=%s:p=?;p=%s:a=%s:o=%s:u=%s:c=1:w=1:s=silent,xdg-names%s",
|
||||
"\033]99;i=%s:p=?;p=%s:a=%s:o=%s:u=%s:c=1:w=1:s=system,silent,error,warn,warning,info,question%s",
|
||||
reply_id, p_caps, a_caps, when_caps, u_caps, terminator);
|
||||
|
||||
xassert(n < sizeof(reply));
|
||||
|
|
@ -817,6 +817,22 @@ kitty_notification(struct terminal *term, char *string)
|
|||
if (decoded != NULL) {
|
||||
free(sound_name);
|
||||
sound_name = decoded;
|
||||
|
||||
const char *translated_name = NULL;
|
||||
|
||||
if (streq(decoded, "error"))
|
||||
translated_name = "dialog-error";
|
||||
else if (streq(decoded, "warn") || streq(decoded, "warning"))
|
||||
translated_name = "dialog-warning";
|
||||
else if (streq(decoded, "info"))
|
||||
translated_name = "dialog-information";
|
||||
else if (streq(decoded, "question"))
|
||||
translated_name = "dialog-question";
|
||||
|
||||
if (translated_name != NULL) {
|
||||
free(sound_name);
|
||||
sound_name = xstrdup(translated_name);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue