diff --git a/kitty/screen.c b/kitty/screen.c index c3db48f5a..0c042e29b 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -3009,6 +3009,11 @@ set_title(Screen *self, PyObject *title) { CALLBACK("title_changed", "O", title); } +void +osc_context(Screen *self, PyObject *ctx) { + CALLBACK("osc_context", "O", ctx); +} + void desktop_notify(Screen *self, unsigned int osc_code, PyObject *data) { CALLBACK("desktop_notify", "IO", osc_code, data); diff --git a/kitty/screen.h b/kitty/screen.h index 07dd46ec5..a81c537fe 100644 --- a/kitty/screen.h +++ b/kitty/screen.h @@ -248,6 +248,7 @@ void screen_pop_colors(Screen *, unsigned int); void screen_report_color_stack(Screen *); void screen_handle_kitty_dcs(Screen *, const char *callback_name, PyObject *cmd); void set_title(Screen *self, PyObject*); +void osc_context(Screen *self, PyObject *ctx); void desktop_notify(Screen *self, unsigned int, PyObject*); void set_icon(Screen *self, PyObject*); void set_dynamic_color(Screen *self, unsigned int code, PyObject*); diff --git a/kitty/vt-parser.c b/kitty/vt-parser.c index 8c56eef40..8c5f9cbe6 100644 --- a/kitty/vt-parser.c +++ b/kitty/vt-parser.c @@ -602,7 +602,10 @@ dispatch_osc(PS *self, uint8_t *buf, size_t limit, bool is_extended_osc) { case 666: REPORT_ERROR("Ignoring OSC 666, typically used by VTE terminals for shell integration"); break; case 697: REPORT_ERROR("Ignoring OSC 697, typically used by Fig for shell integration"); break; case 701: REPORT_ERROR("Ignoring OSC 701, used by mintty for locale"); break; - case 3008: REPORT_ERROR("Ignoring OSC 3008, used by systemd for OSC-context"); break; + case 3008: + START_DISPATCH + DISPATCH_OSC(set_title); + END_DISPATCH case 7704: REPORT_ERROR("Ignoring OSC 7704, used by mintty for ANSI colors"); break; case 7750: REPORT_ERROR("Ignoring OSC 7750, used by mintty for Emoji style"); break; case 7770: REPORT_ERROR("Ignoring OSC 7770, used by mintty for font size"); break; diff --git a/kitty/window.py b/kitty/window.py index 297ddd59c..63affb6ed 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -1286,6 +1286,9 @@ class Window: if self.override_title is None: self.title_updated() + def osc_context(self, ctx_data: memoryview) -> None: + pass # this is systemd's useless OSC 3008 context protocol + def icon_changed(self, new_icon: memoryview) -> None: pass # TODO: Implement this