mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-11 04:27:49 -05:00
osc: 176 (app-id): implement query+reply
Applications can now query for the current app-id with:
\E] 176 ; ? \E\\
The reply is
\E] 176 ; <title> \E\\
This commit is contained in:
parent
0b95e72073
commit
4b075bb075
1 changed files with 12 additions and 0 deletions
12
osc.c
12
osc.c
|
|
@ -917,6 +917,18 @@ osc_dispatch(struct terminal *term)
|
|||
break;
|
||||
|
||||
case 176:
|
||||
if (string[0] == '?' && string[1] == '\0') {
|
||||
const char *terminator = term->vt.osc.bel ? "\a" : "\033\\";
|
||||
char *reply = xasprintf(
|
||||
"\033]176;%s%s",
|
||||
term->app_id != NULL ? term->app_id : term->conf->app_id,
|
||||
terminator);
|
||||
|
||||
term_to_slave(term, reply, strlen(reply));
|
||||
free(reply);
|
||||
break;
|
||||
}
|
||||
|
||||
term_set_app_id(term, string);
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue