osc: add support for osc 176 (app ID)

This adds support for a new OSC escape sequence: OSC 176, that lets
terminal programs tell the terminal the name of the app that is
running. foot then sets the app ID of the toplevel to that ID,
which lets the compositor know which app is running, and typically
sets the appropriate icon, window grouping, ...

See: https://gist.github.com/delthas/d451e2cc1573bb2364839849c7117239
This commit is contained in:
delthas 2023-09-04 14:02:05 +02:00 committed by Daniel Eklöf
parent 4801d3a305
commit 6c56b04b3f
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
8 changed files with 101 additions and 2 deletions

View file

@ -483,6 +483,7 @@ struct terminal {
bool window_title_has_been_set;
char *window_title;
tll(char *) window_title_stack;
char *app_id;
struct {
bool active;
@ -606,6 +607,11 @@ struct terminal {
int timer_fd;
} title;
struct {
struct timespec last_update;
int timer_fd;
} app_id;
uint32_t scrollback_lines; /* Number of scrollback lines, from conf (TODO: move out from render struct?) */
struct {
@ -832,6 +838,7 @@ void term_xcursor_update_for_seat(struct terminal *term, struct seat *seat);
void term_set_user_mouse_cursor(struct terminal *term, const char *cursor);
void term_set_window_title(struct terminal *term, const char *title);
void term_set_app_id(struct terminal *term, const char *app_id);
void term_flash(struct terminal *term, unsigned duration_ms);
void term_bell(struct terminal *term);
bool term_spawn_new(const struct terminal *term);