Skip to content

netbsd: Support building with libcurses#688

Merged
BenBE merged 2 commits intohtop-dev:masterfrom
alarixnia:netbsd-curses
Jul 13, 2021
Merged

netbsd: Support building with libcurses#688
BenBE merged 2 commits intohtop-dev:masterfrom
alarixnia:netbsd-curses

Conversation

@alarixnia
Copy link
Copy Markdown
Contributor

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

Comment thread configure.ac Outdated
Comment thread CRT.c
sigaction (SIGSYS, &act, &old_sig_handler[SIGSYS]);
sigaction (SIGABRT, &act, &old_sig_handler[SIGABRT]);

signal(SIGINT, CRT_handleSIGTERM);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this additional handler?

Copy link
Copy Markdown
Contributor Author

@alarixnia alarixnia Jul 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@BenBE BenBE added build system 🔧 Affects the build system rather then the user experience NetBSD 🎏 NetBSD related issues labels Jul 13, 2021
@BenBE BenBE added this to the 3.1.0 milestone Jul 13, 2021
alarixnia and others added 2 commits July 13, 2021 20:36
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.
@BenBE
Copy link
Copy Markdown
Member

BenBE commented Jul 13, 2021

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.

@BenBE BenBE merged commit bf22a8f into htop-dev:master Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build system 🔧 Affects the build system rather then the user experience NetBSD 🎏 NetBSD related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NetBSD: Unicode support with X/Open Curses

2 participants