helix icon indicating copy to clipboard operation
helix copied to clipboard

Respect SIG_IGN for SIGTSTP (Terminal SToP)

Open AlexanderBrevig opened this issue 2 years ago • 3 comments

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

AlexanderBrevig avatar Aug 03 '22 19:08 AlexanderBrevig

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.

n8henrie avatar Mar 30 '24 14:03 n8henrie

@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?

jrvidal avatar Apr 01 '24 16:04 jrvidal

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.

AlexanderBrevig avatar Apr 02 '24 07:04 AlexanderBrevig