diff --git a/kitty/parser.c b/kitty/parser.c index 764bd05b0..1b7ea3993 100644 --- a/kitty/parser.c +++ b/kitty/parser.c @@ -411,6 +411,7 @@ dispatch_osc(Screen *screen, PyObject DUMP_UNUSED *dump_callback) { START_DISPATCH DISPATCH_OSC_WITH_CODE(set_color_table_color); END_DISPATCH + case 6: case 7: START_DISPATCH DISPATCH_OSC_WITH_CODE(process_cwd_notification); diff --git a/kitty/screen.c b/kitty/screen.c index 334f552c6..9c128d393 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -2070,10 +2070,12 @@ set_color_table_color(Screen *self, unsigned int code, PyObject *color) { } void -process_cwd_notification(Screen *self, unsigned int code UNUSED, PyObject *cwd) { - Py_CLEAR(self->last_reported_cwd); - self->last_reported_cwd = cwd; - Py_INCREF(self->last_reported_cwd); +process_cwd_notification(Screen *self, unsigned int code, PyObject *cwd) { + if (code == 7) { + Py_CLEAR(self->last_reported_cwd); + self->last_reported_cwd = cwd; + Py_INCREF(self->last_reported_cwd); + } // we ignore OSC 6 document reporting as we dont have a use for it } void