diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2024-02-06 12:55:30 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2024-02-06 12:55:30 +0000 |
| commit | 4b075bb0750754f219704b99486605ee81634c7b (patch) | |
| tree | 6490999c189b3ce36ee79726e93ff4b174ffb6b7 /osc.c | |
| parent | Merge branch 'app-id' (diff) | |
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\\
Diffstat (limited to 'osc.c')
| -rw-r--r-- | osc.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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; |
