mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-16 05:24:20 +02:00
...
This commit is contained in:
@@ -255,10 +255,12 @@ class PTY:
|
||||
del self.slave_fd
|
||||
del self.master_fd
|
||||
|
||||
def write_to_child(self, data):
|
||||
def write_to_child(self, data, flush=False):
|
||||
if isinstance(data, str):
|
||||
data = data.encode('utf-8')
|
||||
self.write_buf += data
|
||||
if flush:
|
||||
self.process_input_from_child(0)
|
||||
|
||||
def send_cmd_to_child(self, cmd):
|
||||
self.write_to_child(cmd + '\r')
|
||||
|
||||
@@ -93,7 +93,7 @@ def socket_child_main(exit_code=0, initial_print=''):
|
||||
pty.wait_till(lambda: 'child ready:' in pty.screen_contents())
|
||||
pty.set_window_size(columns=cols + 3)
|
||||
pty.wait_till(lambda: f'Screen size changed: {cols + 3}' in pty.screen_contents())
|
||||
pty.write_to_child('\x03' * 64)
|
||||
pty.write_to_child('\x03' * 64, flush=True)
|
||||
wait_for_death(signal.SIGINT, timeout=30)
|
||||
pty.wait_till(lambda: 'KeyboardInterrupt' in pty.screen_contents(), timeout=30)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user