knqyf263 / pet

Simple command-line snippet manager
MIT License
4.45k stars 224 forks source link

If pressed ctrl -c while pet is running, pet itself will be cancelled. #170

Closed sadayuki-matsuno closed 5 months ago

sadayuki-matsuno commented 3 years ago

After accessing the remote terminal using the pet command, pressing Ctrl-C kills the pet itself and also kills the remote connection.

Below is the result of pressing Ctrl-C when connecting ssm with aws cli

Starting session with SessionId: matsuno-0592da39a5e3bc810
$
$
$
$ Cannot perform start session: read /dev/stdin: input/output error
RamiAwar commented 7 months ago

Ah now I see what your PR was about. So you were accessing a remote terminal using a pet snippet and then you expect ctrl-c to shutdown the remote process only, not Pet, and not your connection!

Definitely an important need.

Can you foresee any problems with having ctrl-c disabled in pet globally?

I'm trying to think whether or not this should be a snippet-specific flag maybe so we don't do it globally. But not sure if running globally is a problem at all.

RamiAwar commented 7 months ago

Need to make sure this doesn't apply to places where we're doing pet search or other pet-specific menus where Ctrl-C is a valid way to exit out of these pet commands.