From a6700c951a438c76285582c50fdfbd04cfb4453a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 15 Dec 2017 09:36:45 +0530 Subject: [PATCH] Also filter 8-bit control sequences when sanitizing --- kitty/utils.py | 2 +- kitty/window.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/utils.py b/kitty/utils.py index a018af262..676a23ff3 100644 --- a/kitty/utils.py +++ b/kitty/utils.py @@ -62,7 +62,7 @@ def timeit(name, do_timing=False): def sanitize_title(x): - return re.sub(r'\s+', ' ', re.sub(r'[\0-\x19]', '', x)) + return re.sub(r'\s+', ' ', re.sub(r'[\0-\x19\x80-\x9f]', '', x)) def color_as_int(val): diff --git a/kitty/window.py b/kitty/window.py index d70748a86..4d0f0a62d 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -289,7 +289,7 @@ class Window: if isinstance(text, str): text = text.encode('utf-8') if self.screen.in_bracketed_paste_mode: - text = text.replace(b'\033[201~', b'') + text = text.replace(b'\033[201~', b'').replace(b'\x9b201~', b'') self.screen.paste(text) def copy_to_clipboard(self):