From dd7caaa91ba850feec0bb3376a9b7b8f7c2ec983 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 15 Oct 2025 08:09:29 +0530 Subject: [PATCH] ... --- kitty/child.py | 4 ++-- kitty_tests/__init__.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kitty/child.py b/kitty/child.py index e75cebb6a..f8fd0a5a8 100644 --- a/kitty/child.py +++ b/kitty/child.py @@ -564,8 +564,8 @@ class Child: return True def reset_termios_state(self) -> None: - if s := getattr(self, 'initial_termios_state', None): + if (s := getattr(self, 'initial_termios_state', None)) and self.child_fd is not None: try: - termios.tcsetattr(s, termios.TCSANOW) + termios.tcsetattr(self.child_fd, termios.TCSANOW, s) except OSError: pass diff --git a/kitty_tests/__init__.py b/kitty_tests/__init__.py index 1ae16fb86..bd9ce655f 100644 --- a/kitty_tests/__init__.py +++ b/kitty_tests/__init__.py @@ -371,7 +371,7 @@ class PTY: def reset_termios_state(self): if s := getattr(self, 'initial_termios_state', None): - termios.tcsetattr(self.master_fd, s) + termios.tcsetattr(self.master_fd, termios.TCSANOW, s) def turn_off_echo(self): s = termios.tcgetattr(self.master_fd)