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

[REQUEST] make <c-c> capturable with RawKey hook #5143

Open
eko234 opened this issue Apr 14, 2024 · 4 comments
Open

[REQUEST] make <c-c> capturable with RawKey hook #5143

eko234 opened this issue Apr 14, 2024 · 4 comments

Comments

@eko234
Copy link
Contributor

eko234 commented Apr 14, 2024

Feature

Make hook <scope> RawKey <c-c> correctly capture the event when is pressed.

Usecase

Hi, I understand why does what it does, but I think when some plugins that use long running processes want to be somehow resilient to sigint propagation, this would be very handy, there might be better ideas to work this around, like having better process management, I don't know if this is something that will be improved in the future, thanks!

@krobelus
Copy link
Contributor

asynchronous subshells already ignore SIGINT by default, see 7b93567 (Reset SIGINT handler in background processes, 2024-03-29) and others

@krobelus
Copy link
Contributor

To elaborate, if your plugin does something like this:

nop %sh{
    (
        sleep inf
    ) >/dev/null 2>&1 </dev/null &
}

the sleep process will not be cancelled by <c-c>

@mawww
Copy link
Owner

mawww commented Apr 17, 2024

The current way to avoid SIGINT for long running processes is to use setsid to get a new process group, it is not strictly posix but has been working fine for now.

@eko234
Copy link
Contributor Author

eko234 commented Apr 19, 2024

Oh, I see, thank you, I will check it out to see if it fits my usecase, but I still think it would be useful to capture C-c, maybe not remap it, but capturing would be nice.

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