From d452a5cdce9a92ba76b0aeb4c2e2928238ac58f1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 24 Feb 2022 00:00:45 +0530 Subject: [PATCH] ... --- kitty/parser.c | 2 +- kitty_tests/__init__.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/kitty/parser.c b/kitty/parser.c index f80f0fd1d..772c34c8c 100644 --- a/kitty/parser.c +++ b/kitty/parser.c @@ -1181,7 +1181,7 @@ START_ALLOW_CASE_RANGE END_ALLOW_CASE_RANGE if (screen->parser_buf_pos > 0 && screen->parser_buf[screen->parser_buf_pos-1] == ESC) { if (ch == '\\') { screen->parser_buf_pos--; return true; } - REPORT_ERROR("DCS sequence contained ESC without trailing \\ ignoring the sequence"); + REPORT_ERROR("DCS sequence contained ESC without trailing \\ at pos: %u ignoring the sequence", screen->parser_buf_pos); SET_STATE(ESC); return false; } if (screen->parser_buf_pos >= PARSER_BUF_SZ - 1) { diff --git a/kitty_tests/__init__.py b/kitty_tests/__init__.py index 07332a1fc..9e0b3a41d 100644 --- a/kitty_tests/__init__.py +++ b/kitty_tests/__init__.py @@ -96,15 +96,17 @@ class Callbacks: def handle_remote_ssh(self, msg): from kittens.ssh.main import get_ssh_data - for line in get_ssh_data(msg): - self.pty.write_to_child(line) - self.pty.process_input_from_child(timeout=0) + if self.pty: + for line in get_ssh_data(msg): + self.pty.write_to_child(line) + self.pty.process_input_from_child(timeout=0) def handle_remote_echo(self, msg): from base64 import standard_b64decode - data = standard_b64decode(msg) - self.pty.write_to_child(data) - self.pty.process_input_from_child(timeout=0) + if self.pty: + data = standard_b64decode(msg) + self.pty.write_to_child(data) + self.pty.process_input_from_child(timeout=0) def filled_line_buf(ynum=5, xnum=5, cursor=Cursor()):