mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-23 08:47:47 +02:00
Only reset termios when user triggers reset action rather than in reponse to reset escape code
Fixes #9126
This commit is contained in:
@@ -563,9 +563,9 @@ class Child:
|
|||||||
os.killpg(pgrp, s)
|
os.killpg(pgrp, s)
|
||||||
return True
|
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:
|
if (s := getattr(self, 'initial_termios_state', None)) and self.child_fd is not None:
|
||||||
try:
|
try:
|
||||||
termios.tcsetattr(self.child_fd, termios.TCSANOW, s)
|
termios.tcsetattr(self.child_fd, when, s)
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
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}')
|
self.screen.send_escape_code_to_child(ESC_OSC, f'{code};rgb:{r:04x}/{g:04x}/{b:04x}')
|
||||||
|
|
||||||
def on_reset(self) -> None:
|
def on_reset(self) -> None:
|
||||||
self.child.reset_termios_state()
|
pass
|
||||||
|
|
||||||
def notify_child_of_resize(self) -> None:
|
def notify_child_of_resize(self) -> None:
|
||||||
pty_size = self.last_reported_pty_size
|
pty_size = self.last_reported_pty_size
|
||||||
@@ -1918,6 +1918,7 @@ class Window:
|
|||||||
self.screen.cursor.x = self.screen.cursor.y = 0
|
self.screen.cursor.x = self.screen.cursor.y = 0
|
||||||
if reset:
|
if reset:
|
||||||
self.screen.reset()
|
self.screen.reset()
|
||||||
|
self.child.reset_termios_state()
|
||||||
else:
|
else:
|
||||||
self.screen.erase_in_display(3 if scrollback else 2, False)
|
self.screen.erase_in_display(3 if scrollback else 2, False)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user