From 01969cae1af703fd6b608036177a7d3f973034ea Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 14 Oct 2022 12:06:48 +0530 Subject: [PATCH] More useful PARSE ERROR msg for unknown @ commands --- kitty/parser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kitty/parser.c b/kitty/parser.c index edbdc7cd2..603779516 100644 --- a/kitty/parser.c +++ b/kitty/parser.c @@ -1093,7 +1093,9 @@ dispatch_dcs(Screen *screen, PyObject DUMP_UNUSED *dump_callback) { } else IF_SIMPLE_PREFIX("edit|", handle_remote_edit) #undef IF_SIMPLE_PREFIX } else { - REPORT_ERROR("Unrecognized DCS @ code: 0x%x", screen->parser_buf[1]); + PyObject *tp = PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND, screen->parser_buf, screen->parser_buf_pos); + REPORT_ERROR("Unrecognized DCS @ code: %s", tp ? PyUnicode_AsUTF8(tp) : "could not read"); + Py_XDECREF(tp); } } break;