From c983f002c14c348bcc908ddb0bef42b12eebab3b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 24 Nov 2016 13:57:00 +0530 Subject: [PATCH] Also silently ignore attempts to change charset to US-ASCII (apparently curses does that a lot) --- kitty/parser.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kitty/parser.c b/kitty/parser.c index 98d63cc62..369d22353 100644 --- a/kitty/parser.c +++ b/kitty/parser.c @@ -183,10 +183,10 @@ handle_esc_mode_char(Screen *screen, uint32_t ch, PyObject DUMP_UNUSED *dump_cal } break; default: - if (screen->parser_buf[0] == '%' && ch == 'G') { - // switch to utf-8, since we are always in utf-8, ignore. + if ((screen->parser_buf[0] == '%' && ch == 'G') || (screen->parser_buf[0] == '(' && ch == 'B')) { + // switch to utf-8 or ascii, since we are always in utf-8, ignore. } else { - REPORT_ERROR("Unhandled charset related escape code: 0x%x 0x%x", screen->parser_buf[0], screen->parser_buf[1]); + REPORT_ERROR("Unhandled charset related escape code: 0x%x 0x%x", screen->parser_buf[0], ch); } SET_STATE(0); break; @@ -611,6 +611,7 @@ FNAME(read_bytes)(PyObject UNUSED *self, PyObject *args) { if (errno == EIO) { Py_RETURN_FALSE; } return PyErr_SetFromErrno(PyExc_OSError); } + /* PyObject_Print(Py_BuildValue("y#", screen->read_buf, len), stderr, 0); */ break; } _parse_bytes(screen, screen->read_buf, len, dump_callback);