mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-25 10:27:24 +00:00
Only reset termios when user triggers reset action rather than in reponse to reset escape code
Fixes #9126
This commit is contained in:
parent
0780eef7b1
commit
c2fb9f14b5
2 changed files with 4 additions and 3 deletions
|
|
@ -563,9 +563,9 @@ class Child:
|
|||
os.killpg(pgrp, s)
|
||||
return True
|
||||
|
||||
def reset_termios_state(self) -> None:
|
||||
def reset_termios_state(self, when: int = termios.TCSANOW) -> None:
|
||||
if (s := getattr(self, 'initial_termios_state', None)) and self.child_fd is not None:
|
||||
try:
|
||||
termios.tcsetattr(self.child_fd, termios.TCSANOW, s)
|
||||
termios.tcsetattr(self.child_fd, when, s)
|
||||
except OSError:
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -1334,7 +1334,7 @@ class Window:
|
|||
self.screen.send_escape_code_to_child(ESC_OSC, f'{code};rgb:{r:04x}/{g:04x}/{b:04x}')
|
||||
|
||||
def on_reset(self) -> None:
|
||||
self.child.reset_termios_state()
|
||||
pass
|
||||
|
||||
def notify_child_of_resize(self) -> None:
|
||||
pty_size = self.last_reported_pty_size
|
||||
|
|
@ -1918,6 +1918,7 @@ class Window:
|
|||
self.screen.cursor.x = self.screen.cursor.y = 0
|
||||
if reset:
|
||||
self.screen.reset()
|
||||
self.child.reset_termios_state()
|
||||
else:
|
||||
self.screen.erase_in_display(3 if scrollback else 2, False)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue