helix
helix copied to clipboard
Respect SIG_IGN for SIGTSTP (Terminal SToP)
Describe your feature request
When using shells without job control (such as https://elv.sh), respect the SIG_IGN
that's set for SIGTSTP
so C-z
does not suspend Helix.
When I C-z now, the only way out (that I've found) is to do a hard shutdown of the terminal.
I have lost quite a lot of work because of this. (Yes, I know I could use a different shell but I'm weird like that).
https://github.com/elves/elvish/pull/1017
Shame that https://github.com/helix-editor/helix/pull/3322 was closed -- looks like it was close?
This is still an issue with nushell and helix 23.10. Oh, looks like 24.03 was released a few minutes ago -- will also try with that.
@archseer I see that #3322 was dismissed in favor of letting signal-hook
take care of it. You mentioned in https://github.com/helix-editor/helix/pull/3322#pullrequestreview-1150174089:
I do see they have a check for SIG_IGN: https://github.com/vorner/signal-hook/blob/1236c57dc8a319a410d0c3a68dcd1fc0aa8488a2/signal-hook-registry/src/lib.rs#L236
I don't think that check would work for us: that is about running a previously installed handler if there is any (i.e. if, among other things, it was not set to SIG_IGN
). But calling Signals::new(...)
always overwrites an existing SIG_IGN
.
Could we maybe reopen #3322 and open an upstream issue to see if they can accommodate our use case?
To be honest I just gave up on it after five months. I'm of course OK with reopening the PR and do another pass - if the intention of merging it is clear.