Skip to content

Commit

Permalink
Merge branch 'htop-dev:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex313031 authored Jan 18, 2024
2 parents ab79c5e + 91990b1 commit 8f631b7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
13 changes: 12 additions & 1 deletion CRT.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,8 +803,19 @@ int CRT_scrollWheelVAmount = 10;
ColorScheme CRT_colorScheme = COLORSCHEME_DEFAULT;

ATTR_NORETURN
static void CRT_handleSIGTERM(ATTR_UNUSED int sgn) {
static void CRT_handleSIGTERM(int sgn) {
CRT_done();

if (!CRT_crashSettings->changed)
_exit(0);

const char* signal_str = strsignal(sgn);
if (!signal_str)
signal_str = "unknown reason";

fprintf(stderr,
"A signal %d (%s) was received, exiting without persisting settings to htoprc.\n",
sgn, signal_str);
_exit(0);
}

Expand Down
2 changes: 1 addition & 1 deletion MainPanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static HandlerResult MainPanel_eventHandler(Panel* super, int ch) {
} else {
reaction |= Action_setSortKey(settings, field);
}
reaction |= HTOP_RECALCULATE | HTOP_REDRAW_BAR | HTOP_SAVE_SETTINGS;
reaction |= HTOP_RECALCULATE | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR | HTOP_SAVE_SETTINGS;
result = HANDLED;
} else if (EVENT_IS_SCREEN_TAB_CLICK(ch)) {
int x = EVENT_SCREEN_TAB_GET_X(ch);
Expand Down
5 changes: 4 additions & 1 deletion Process.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,10 @@ int Process_compare(const void* v1, const void* v2) {
}

int Process_compareByParent(const Row* r1, const Row* r2) {
int result = Row_compareByParent_Base(r1, r2);
int result = SPACESHIP_NUMBER(
r1->isRoot ? 0 : Row_getGroupOrParent(r1),
r2->isRoot ? 0 : Row_getGroupOrParent(r2)
);

if (result != 0)
return result;
Expand Down

0 comments on commit 8f631b7

Please sign in to comment.