knqyf263 / pet

Simple command-line snippet manager
MIT License
4.54k stars 230 forks source link

feat(exec) ignore ctrl-c when exec #171

Open sadayuki-matsuno opened 3 years ago

sadayuki-matsuno commented 3 years ago

170

Description of changes:

ignore ctrl-c in pet exec

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

RamiAwar commented 6 months ago

Thinking about this again to cover edge cases:

1- If user runs a process with Pet, they expect any following keyboard events to go to that process. Pet should not be intervening anymore.

2- The second a sub-process ends, Pet will also stop. We don't have to worry about having Pet hang here I think. Only concern is that the sub-processs hangs which is the user's responsibility.

3- Do we need to have this be under a flag? -> No because there is no expectation from users that Ctrl+C will end Pet, the parent process that launched this subprocess. Users don't even know that Pet is still running and shouldn't care about this.

SO I think we can just merge this as is now!