From 5e2255591c37b7217c04cb1b0cdb2cab7ee0e906 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 14 Oct 2022 12:12:58 +0530 Subject: [PATCH] Dont send invalid kitty-cmd escape code over tty --- tools/cmd/at/tty_io.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/cmd/at/tty_io.go b/tools/cmd/at/tty_io.go index 70ce9175b..6fb63408f 100644 --- a/tools/cmd/at/tty_io.go +++ b/tools/cmd/at/tty_io.go @@ -85,10 +85,11 @@ func do_chunked_io(io_data *rc_io_data) (serialized_response []byte, err error) } return "", err } - queue_escape_code(chunk) if len(chunk) == 0 { state = WAITING_FOR_RESPONSE transition_to_read() + } else { + queue_escape_code(chunk) } return "", nil } @@ -104,10 +105,11 @@ func do_chunked_io(io_data *rc_io_data) (serialized_response []byte, err error) } return err } - queue_escape_code(chunk) if len(chunk) == 0 { state = WAITING_FOR_RESPONSE transition_to_read() + } else { + queue_escape_code(chunk) } if state == BEFORE_FIRST_ESCAPE_CODE_SENT { if wants_streaming {