term: remove interrupt handler on termios#31
Conversation
On termios platforms, interrupt signals are not generated in raw mode terminals as the ISIG setting is not enabled. Remove interrupt handler as it does nothing for raw mode and prevents other uses of INT signal with this library. This code seems to go back all the way to moby/moby#214 where signal handling was improved for monolithic docker repository. Raw mode -ISIG got reintroduced in moby/moby@3f63b878076, but the INT handler was left behind. Signed-off-by: Sami Loone <sloone@forcepoint.com>
|
@creack @tianon @cpuguy83 I could use some help on this one; does any of you have any ideas if there could be some obscure reason why this would still be needed? I realise it's been a long time since this was added, but perhaps there was some reason that I'm overlooking and that may still be relevant. See docker/cli#3801 for more details (and I opened docker/cli#3849 to see if CI would explode, but all looks good on that front) |
|
Exiting the parent process upon SIGINT is quite an unexpected behavior..., especially with code 1. There is a difference between the terminal and the process. Even if the raw mode is set, while CTRL-C user input may not result in a SIGINT, something like LGTM for Linux/BSD, however maybe it was put there for Windows? No clue. That behind said, it would be a behavior change. Maybe some projects are relying on this. |
|
Hey, thanks for taking a look.
Would this code run on Windows in some scenario? There is a split |
Yes, this wouldn't affect Windows; the commit that introduced it (moby/moby@3f63b878076) was also long before we had support for Windows, so I don't expect it to be related. Thank you both for the extra eyes / input! Let me go ahead and get this one in; I think this should be ok to get in, but (worst case) if we run into issues, we can always revert, or give it another look. |
On termios platforms, interrupt signals are not generated in raw mode terminals as the ISIG setting is not enabled. Remove interrupt handler as it does nothing for raw mode and prevents other uses of INT signal with this library.
This code seems to go back all the way to moby/moby#214 where signal handling was improved for monolithic docker repository. Raw mode -ISIG got reintroduced in moby/moby@3f63b878076, but the INT handler was left behind.
Signed-off-by: Sami Loone sloone@forcepoint.com