From 57bb144d96c0f9d48a2b0a6d43c9a23d2a091cbf Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 1 Sep 2026 20:59:31 +0530 Subject: [PATCH] More efficient is digit check Also fixes the previous check allowing trailing newlines --- kitty/window.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kitty/window.py b/kitty/window.py index 884b1ae5c..4cb8d7c7a 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -1726,10 +1726,10 @@ class Window: def handle_remote_echo(self, msg: memoryview) -> None: # This is used by the ssh kitten to flush garbage from the tty on exit data = base64_decode(msg) - if re.match(rb'\d+$', data) is None: - log_error(f'Invalid echo message received from client: {data!r}') - else: + if data.isdigit(): self.write_to_child(data) + else: + log_error(f'Invalid echo message received from client: {data!r}') def handle_remote_ssh(self, msg: memoryview) -> None: from kittens.ssh.utils import get_ssh_data