Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle interrupt signal on ssh kitten when connecting #5271

Closed
zasdaym opened this issue Jul 13, 2022 · 3 comments
Closed

Handle interrupt signal on ssh kitten when connecting #5271

zasdaym opened this issue Jul 13, 2022 · 3 comments

Comments

@zasdaym
Copy link

zasdaym commented Jul 13, 2022

Is your feature request related to a problem? Please describe.
When the ssh kitten is connecting to the ssh server, pressing Ctrl+C does not cancel or interrupt the ssh connection in progress.

Describe the solution you'd like
The ssh kitten immediately cancels the connection with the ssh server when Ctrl+C is pressed.

Describe alternatives you've considered
None

Additional context
None

@kovidgoyal
Copy link
Owner

It's not possible to do this given the way the ssh kitten operates.

@page-down
Copy link
Contributor

I sometimes encounter this too.
When ssh is unable to connect for a long time, for example when the host is not powered on, it will keep hanging and kitty will eventually output the encoded data into the shell (command prompt).

fish: Unknown command: ...
fish: Unknown command: ...
...

Currently I only use the default configuration for certain hosts and ask before sending for others.

kitty +kitten ssh --kitten="askpass ssh"

Maybe the current process of the window can be checked before sending the encoded data.

@kovidgoyal
Copy link
Owner

The encoded data is sent before and independently of ssh. It sits in
the pipe waiting for ssh to read it. There is no way to have ssh signal,
the terminal to start sending data. If you want that behavior you can
set askpass to ssh in ssh.conf then kitty will wait for the connection
to be established, and only once it gets a request from the remote
machine will it send the data. This means ctrl-c will work and you wont
get data spillover into the terminal when ssh fails, but at the cost of
an extra roundtrip before data transmission can start, meaning a big
increase in time-to-prompt ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants