From 179c2b21c050b3c00678c85dbcd465daafafa1e7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 14 Jul 2021 22:07:15 +0530 Subject: [PATCH] Make debug_print remove esc and bel Should really be made more robust, but cant be bothered --- kitty/window.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kitty/window.py b/kitty/window.py index 0cd2a0b38..63dfaad52 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -778,6 +778,11 @@ class Window: def handle_remote_print(self, msg: bytes) -> None: from base64 import standard_b64decode text = standard_b64decode(msg).decode('utf-8') + + def green(x: str) -> str: + return f'\x1b[32m{x}\x1b[39m' + + text = text.replace('\x1b', green(r'\e')).replace('\a', green(r'\a')).replace('\0', green(r'\0')) print(text, end='', file=sys.stderr) sys.stderr.flush()