Commit Graph

2372 Commits

Author SHA1 Message Date
Daniel Lange 8a67d7f086 Merge branch 'RichString_attrn' of cgzones/htop 2021-01-11 09:36:42 +01:00
Daniel Lange 0b89c66f58 Merge branch 'following_exit' of cgzones/htop 2021-01-11 09:36:25 +01:00
Christian Göttsche 3bb731c645 RichString_setAttrn: refactor to take a length instead of a stop index
Fixes: #459
2021-01-10 16:51:25 +01:00
Christian Göttsche fbaa0cd146 Exit follow mode cleanly after followed process dies 2021-01-10 16:43:24 +01:00
Christian Göttsche a076488809 Solaris: make Process callbacks static
Fixes prototype of SolarisProcess_compareByKey since 90ea3ac3
2021-01-09 20:17:31 +01:00
Christian Göttsche 6301d5c1da Convert unnecessary static variables
They are not used in any other function and are not used maybe
uninitialized.
2021-01-09 14:31:07 +01:00
Daniel Lange 4979245aa5 Update help and man page for improved -t / -s options 2021-01-08 21:34:30 +01:00
Christian Göttsche 0155980fd6 Free memory on multiple filter command line arguments 2021-01-08 21:07:05 +01:00
Daniel Lange 2af90b711f Merge branch 'err_h' of cgzones/htop 2021-01-08 17:39:04 +01:00
Daniel Lange d55f394541 Merge branch 'light_color' of cgzones/htop 2021-01-08 17:35:26 +01:00
Daniel Lange c7d93a8f30 Merge branch 'ncurses_format' of cgzones/htop 2021-01-08 17:31:06 +01:00
Christian Göttsche 2d2a2df6f2 Refactor crash handler message to avoid embedded directive
CRT.c:821:2: error: embedding a directive within macro arguments has undefined behavior [-Werror,-Wembedded-directive]
#ifdef HAVE_EXECINFO_H
 ^
CRT.c:823:2: error: embedding a directive within macro arguments has undefined behavior [-Werror,-Wembedded-directive]
#endif
 ^
CRT.c:858:2: error: embedding a directive within macro arguments has undefined behavior [-Werror,-Wembedded-directive]
#ifdef HTOP_DARWIN
 ^
CRT.c:862:2: error: embedding a directive within macro arguments has undefined behavior [-Werror,-Wembedded-directive]
#endif
 ^

CRT.c:864:2: error: embedding a directive within macro arguments has undefined behavior [-Werror,-Wembedded-directive]
#ifdef HTOP_DARWIN
 ^
CRT.c:868:2: error: embedding a directive within macro arguments has undefined behavior [-Werror,-Wembedded-directive]
#endif
 ^
2021-01-08 16:53:16 +01:00
Christian Göttsche de645ea16c ci: enable format attributes in ncurses headers
Avoid format string issues like bfcb8ca0 by helping compilers spot such
bogus usages.

Also use LTO and O3 in the full-featured gcc job, which might trigger
additional warnings on advanced inlining, like
3695cbd5d8 and
ad3acfc847
2021-01-08 14:05:56 +01:00
Christian Göttsche 6ae56f2578 Revert color change on LightTerminal
Partially revert 4b14ab9789

ColorPair(Black,Black) is not actually black on black, but due to
adjustments in CRT_setColors() black on default-background-color.

Thanks to V for reporting.
2021-01-08 11:25:25 +01:00
V bfcb8ca019 InfoScreen: fix uncontrolled format string
mvwprintw takes a format string as its fourth argument, and title is
user-controlled. This results in e.g. crashing when trying to trace a
process with a format specifier in its command line.
2021-01-08 11:06:38 +01:00
Christian Göttsche d800d7a3ce Drop usage of formatted error messages from <err.h>
They do not clean up the ncurses environment, leaving the terminal in a
broken state.

Also drop bare usage of exit(3).
2021-01-07 16:10:05 +01:00
Christian Göttsche 27db9297b7 Show arrow indicating order of sorted process column 2021-01-07 14:46:44 +01:00
Christian Göttsche 330d4fe22f Unify prototype of Vector_get
Vector_get() currently takes a `const Vector*` in debug mode and a
`Vector*` else.
2021-01-06 17:14:06 +01:00
Christian Göttsche 8e10cde800 Hashtable: fail hard on too big size request 2021-01-06 16:59:28 +01:00
Christian Göttsche ca2c01bd16 Hashtable: widen size from int to size_t 2021-01-06 16:59:28 +01:00
Christian Göttsche 7043a93eba Hashtable: hide implementation of Hashtable and HashtableItem 2021-01-06 16:59:28 +01:00
Christian Göttsche 8fe04b7494 Hashtable: use more distinct typename for key type 2021-01-06 16:59:28 +01:00
Matej Dian 43d5c61884 LibSensors: add support for Ryzen CPUs 2021-01-06 16:54:59 +01:00
Christian Göttsche e103ec0317 Declare for loop variables inside the loop 2021-01-06 16:43:18 +01:00
Christian Göttsche 7ff654f2df Drop useless double parenthesis 2021-01-06 16:42:54 +01:00
Christian Göttsche 7386c6fed0 Avoid function cast by refactoring callback prototype 2021-01-06 16:42:45 +01:00
Christian Göttsche ce9e7fd14f Panel_new: reorder arguments
Reorder owner and type so they match the order of Panel_init
2021-01-04 23:12:43 +01:00
Christian Göttsche badeaf9e82 IncSet: do not resize on our own and do not search on resize
The supervising ScreenManager will resize all Panels.
Also do not start the search on resize.
2021-01-04 23:12:43 +01:00
Christian Göttsche a3cced9fb6 Add option to hide the Function Bar
Support three settings:
  - Always show Function Bar
  - Always hide the Function Bar, except in Infoscreens (Env/Locks...)
    and when editing the search and filter mode
  - Hide the Function Bar on ESC until the next user input

Closes: #439
2021-01-04 23:12:43 +01:00
Christian Göttsche 24c5ca9ddf Panel: rework hight logic
The hight of a Panel dpends on whether the Panel has a header or not.
Also the header migth not be set on Panel creation, like in the
MainPanel. This currently causes the cursor to get hidden behind the
FunctionBar on down-scrolling.
2021-01-04 23:12:43 +01:00
Christian Göttsche eb6f8d569d Action: drop resize callback
The supervising ScreenManager will resize all Panels
2021-01-04 23:12:43 +01:00
Christian Göttsche 8c8149d146 XUtils: check for multiplication overflow in allocation size 2021-01-02 22:35:13 +01:00
Luke Groeninger a150a81669 Fix CPU percentage on M1 silicon Macs 2021-01-02 22:33:20 +01:00
Christian Göttsche 90ea3ac3c9 Object: return int on comparison
Comparisons do, due to the new introduced shaceship-comparisons,
only return -1, 0, 1 or the result of strcmp().
2021-01-02 00:00:17 +01:00
Christian Göttsche 293c16e22d Only initialize and gather delay accounting data if a related column is enabled
Avoid creating and communicating over a netlink socket by default, which
triggers cap_net_admin checks as root.
2021-01-01 21:34:22 +01:00
Christian Göttsche f6aa5d29bb Action: remove trivial wrapper function 2021-01-01 21:31:30 +01:00
Christian Göttsche 2c06566405 LoadMeter: dynamically adjust color and total of bar
Change the color and total based on the actual 1min load value:

    < 1         : green and total of 1.0
    < cpu-count : yellow and total of cpu-count
    else        : red and total of 2*cpu-count

Closes: #32
2020-12-26 13:32:29 +01:00
Christian Göttsche d609c04fe4 CRT: add METER_VALUE_ERROR and adjust some METER_VALUE_WARN colors 2020-12-26 13:32:29 +01:00
Daniel Lange ca9d7cd708 Also find libsensors.so.4 for Fedora and friends 2020-12-25 13:05:37 +01:00
Daniel Lange debeac49cd Merge branch 'cpufreq' of hadfl/htop for Solaris / OmniOS support 2020-12-25 12:24:03 +01:00
Daniel Lange a0b899f29d Note Shift-F3 use in man page 2020-12-25 11:53:02 +01:00
Daniel Lange 8b83a9f055 Enable going back to previous search matches (Shift-F3) 2020-12-25 11:53:02 +01:00
Dominik Hassler 495f2292dc add support to display CPU frequencies on Solarish platforms 2020-12-25 09:26:50 +00:00
Daniel Lange 1cc3f8074f Merge branch 'user_wide' of cgzones/htop 2020-12-23 22:55:35 +01:00
Christian Göttsche aa08279964 Linux: accept clock CPU frequency
processor   : 0
cpu         : POWER8 (architected), altivec supported
clock       : 4024.000000MHz
revision    : 2.0 (pvr 004d 0200)

Closes: #424
2020-12-23 19:58:10 +01:00
Christian Göttsche 5359eae28b Process: use correct column aligning on wide username
Closes: #421
2020-12-23 19:56:51 +01:00
Jake Mannens f1463fdd64 Added keybind 'N' for sorting by PID 2020-12-23 18:30:26 +01:00
Jake Mannens 3edb6e1ea3 Position help labels one step to the right 2020-12-23 18:24:22 +01:00
Daniel Lange 71ddc6a6a1 Merge branch 'remove-n-keybind' of jakem72360/htop 2020-12-23 18:22:17 +01:00
Dominik Hassler b9336af76f fix argument type following prototype change in "Invert Process_compare resolution so that superclass matches run first" 2020-12-23 17:35:23 +01:00