mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-25 01:38:02 +02:00
ssh kitten: Allow pressing Ctrl-C to abort ssh before the connection is completed
Fixing this involved adding a new mode to kitty where it handles ctrl-c/z/q by sending signals to the tty foreground process group instead of delegating to the kernel to do that. Since the pipe may be full we have no way of knowing when the kernel will get around to reading the signal byte. So send the signal ourselves. Fixes #5271
This commit is contained in:
@@ -857,6 +857,13 @@ class Window:
|
||||
'--ssh-connection-data', json.dumps(conn_data)
|
||||
)
|
||||
|
||||
def send_signal_for_key(self, key_num: int) -> bool:
|
||||
try:
|
||||
return self.child.send_signal_for_key(key_num)
|
||||
except OSError as err:
|
||||
log_error(f'Failed to send signal for key to child with err: {err}')
|
||||
return False
|
||||
|
||||
def focus_changed(self, focused: bool) -> None:
|
||||
if self.destroyed:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user