netbsd: Support building with libcurses#688
Merged
BenBE merged 2 commits intohtop-dev:masterfrom Jul 13, 2021
Merged
Conversation
BenBE
reviewed
Jul 13, 2021
| sigaction (SIGSYS, &act, &old_sig_handler[SIGSYS]); | ||
| sigaction (SIGABRT, &act, &old_sig_handler[SIGABRT]); | ||
|
|
||
| signal(SIGINT, CRT_handleSIGTERM); |
Contributor
Author
There was a problem hiding this comment.
ncurses installs its own signal handler for SIGINT, more traditional curses implementations don't. Handling SIGINT ensures the terminal's state is properly reset on Ctrl+C.
Right now Unicode support must be disabled, because htop peeks into the ncurses cchar_t struct with Unicode enabled. NetBSD's cchar_t has different contents. Partially fixes htop-dev#660 Signed-off-by: Nia Alarie <nia@NetBSD.org>
This SIGINT handler is installed on top of an optional handler that some curses/ncurses implementations provide. This ensures the curser is properly reset when hitting Ctrl+C.
Member
|
I split the SIGINT handler into its own commit, as that one affects all platforms. Actually the behavior on Ctrl+C still isn't optimal (maybe best should perform a regular quit, but without saving anything), but that's best left for another PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Right now Unicode support must be disabled, because htop peeks
into the ncurses cchar_t struct with Unicode enabled. NetBSD's cchar_t
has different contents.
Partially fixes #660