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):