Commit Graph

55 Commits

Author SHA1 Message Date
Daniel Lange
c6f946edd2 Improve MainPanel Label on active inc filter (Filter <-> FILTER) 2022-03-25 14:51:14 +01:00
Hisham Muhammad
72ba20fa5f Introduce screen tabs
This is a forward port (by nathans) of Hisham's original code.
2021-12-07 17:04:49 +11:00
fraggerfox
d23627fda9 Adds a missing HAVE_GETMOUSE check.
Fixes builds failing with error
MainPanel.c:65:62: error: 'Settings {aka struct Settings_}' has no member named 'enableMouse'
    if (ch != ERR && (ch != KEY_MOUSE || this->state->settings->enableMouse))
2021-09-29 22:21:53 +02:00
Daniel Lange
94ad111391 Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
Christian Göttsche
bf7d98e7ac MainPanel: do not reset on disabled mouse events
Do not reset the hidden process selection (and hidden function bar) on mouse events, when mouse support is disabled.
2021-09-18 11:48:32 +02:00
Christian Göttsche
68f2bfea61 Abstract resize handling by adding a new Htop reaction 2021-08-22 10:40:59 +02:00
Christian Göttsche
5dbca0193d Make MainPanel_pidSearch a static function
Not used elsewhere.
2021-04-21 20:58:28 +02:00
Christian Göttsche
36880cd61c Add read-only option
Add command line option to disable all system and process changing
features.
2021-04-14 17:21:43 +02:00
Christian Göttsche
d72b0a682e Mark several non-modified pointer variables const 2021-01-11 20:12:34 +01:00
Christian Göttsche
7386c6fed0 Avoid function cast by refactoring callback prototype 2021-01-06 16:42:45 +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
86d2931255 Restore highlighted header of current sorted process column 2020-12-23 12:47:04 +01:00
Christian Göttsche
e3862aa67e Rework drawing of FunctionBar
Draw the FunctionBar within Panel_draw instead of manually throughout
the code.
Add an optional PanelClass function drawFunctionBar, to allow specific
panels to override the default FunctionBar_draw call.
Rework the code on color change, to really change all colors (selection
markers and panel headers).

Closes: #402
2020-12-20 17:01:50 +01:00
Hisham Muhammad
2327260ee8 Separate tree and list sort orders
Implements the suggestion from https://github.com/htop-dev/htop/issues/399#issuecomment-747861013

Thanks to the refactors from 0bd5c8fb5da and 6393baa74e5, this was really easy
and clean to do.

It maintains the "Tree view always by PID" option in the Settings, which
results in some specific behaviors such as "clicking on the column header to
exit tree view" and "picking a new sort order to exit tree view", for the sake
of the muscle memory of long time htop users. :)
2020-12-19 16:02:34 +01:00
Hisham Muhammad
e8c6994f40 Add "Tree view is always sorted by PID" option to mimic htop 2 behavior 2020-12-19 16:02:34 +01:00
Christian Göttsche
edd6130be7 MainPanel: use actual KEY_RESIZE instead of KEY_SHUFFLE
KEY_RESIZE (0632) is equal to KEY_SHUFFLE (0x19a)
2020-12-16 19:12:50 +01:00
Christian Göttsche
107e3c8aa5 MainPanel: do not reset hideProcessSelection on KEY_SHUFFLE
KEY_SHUFFLE might get send from time to time, e.g. in a tmux session.
2020-12-15 14:23:09 +01:00
Benny Baumann
c6b66a75ea Minor code streamlining 2020-12-02 23:50:05 +01:00
Maxim Zhiburt
cf306ff86e Implement sorting in tree mode 2020-12-02 23:50:05 +01:00
Christian Göttsche
19b5141685 Hide process selection on ESC
Do not highlight the current process line after pressing ESC in the main
screen.
Restore after pressing any key.
2020-11-28 19:49:38 +01:00
Narendran Gopalakrishnan
09fe94da18 Improving Command display/sort 2020-11-24 19:05:48 +01:00
Christian Göttsche
91317322fe Mark ProcessList_keyAt argument const 2020-11-15 18:35:30 +01:00
Benny Baumann
45869513bf Embracing branches 2020-11-02 22:15:01 +01:00
Benny Baumann
61e14d4bb2 Spacing around operators 2020-11-02 22:15:01 +01:00
Benny Baumann
0f5262917f Make all required includes explicit
Information as seen by IWYU 0.12 + clang 9 on Linux
2020-10-18 20:09:05 +02:00
Christian Göttsche
b47bc667a2 Add key to pause process list updates 2020-10-12 13:04:00 +02:00
Christian Göttsche
fc301b7447 Compress size of default FunctionBar 2020-10-12 13:04:00 +02:00
Christian Göttsche
ba282cfe19 Mark Object instances const 2020-10-07 13:01:53 +02:00
Daniel Lange
079c2abf8e Update License consistently to GPLv2 as per COPYING file 2020-10-05 10:13:12 +02:00
Christian Göttsche
8a849bc85a Call character checking function with unsigned char
See https://wiki.sei.cmu.edu/confluence/display/c/STR37-C.+Arguments+to+character-handling+functions+must+be+representable+as+an+unsigned+char
2020-09-17 22:03:24 +02:00
Zev Weiss
a1a027b9bd Axe automated header generation.
Reasoning:
 - implementation was unsound -- broke down when I added a fairly
   basic macro definition expanding to a struct initializer in a *.c
   file.

 - made it way too easy (e.g. via otherwise totally innocuous git
   commands) to end up with timestamps such that it always ran
   MakeHeader.py but never used its output, leading to overbuild noise
   when running what should be a null 'make'.

 - but mostly: it's just an awkward way of dealing with C code.
2020-09-03 11:58:58 -05:00
Nathan Scott
e25ac8557d Merge branch 'hishamhm-pull-949' 2020-08-20 14:48:47 +10:00
Nathan Scott
a82fd262d7 Merge branch 'hishamhm-pull-960' 2020-08-20 14:19:53 +10:00
Nathan Scott
500fb283e9 Resolve compiler warnings and errors relating to the Arg union
Promote the Arg union to a core data type in Object.c such
that it is visible everywhere (many source files need it),
and correct declarations of several functions that use it.

The Process_sendSignal function is also corrected to have
the expected return type (bool, not void) - an error being
masked by ignoring this not-quite-harmless warning.  I've
also added error checking to the kill(2) call here, which
was previously overlooked / missing (?).
2020-08-20 09:35:33 +10:00
Daniel Flanagan
dd33444f7e Clean up existing whitespace 2019-10-31 11:39:12 -05:00
duchampdev
18a60d668d MainPanel: add seventh char to main functions
reason: currently, for example 'search' and 'filter' look very densely packed
2019-09-12 22:45:34 +02:00
Hisham Muhammad
8c653212c0 Replace size_t with int/void* union
I was occasionally passing negative values to size_t.
Plus, this better reflects the intent of the variant argument.

Reported by Coverity:
https://scan8.coverity.com/reports.htm#v13253/p10402/fileInstanceId=22093891&defectInstanceId=7543346&mergedDefectId=174179&fileStart=251&fileEnd=500
2018-02-18 10:38:49 -03:00
Richard
d5faf64374 Mark some things as const
Several string pointer arrays pointed to const strings
but were not const themselves.

A few various structures and arrays were also marked const.
2017-07-22 22:34:30 -05:00
Hisham
ef879b4a22 'Follow' only if element is found in search 2016-07-28 11:37:44 -03:00
Hisham
0128d222b9 Added Ctrl+A and Ctrl+E to go to beginning and end of line.
(Also, '^' and '$')
Closes #508.
2016-06-15 12:45:23 -03:00
Hisham
6cc0a8c820 Make sure a pointer fits in the argument! 2016-05-25 16:46:47 -03:00
Hisham
572546f806 Auto-follow process after a search.
See #237.
2016-05-05 10:30:06 -03:00
Hisham
b54d2dde40 Check for failure in allocations. 2016-02-02 15:53:02 +01:00
Hisham Muhammad
70cd5c2b88 Check range when accessing keys table.
Should fix #321.
2016-01-03 16:31:44 -02:00
Hisham Muhammad
c9cab824e9 Extra checks. 2015-08-20 01:13:20 -03:00
Hisham Muhammad
64ecba2583 update bar when clicking header. 2015-04-09 16:02:14 -03:00
Hisham Muhammad
b1f934c5d5 Visual tweaks: change color when following, add Broken Gray theme. 2015-04-09 15:17:20 -03:00
Hisham Muhammad
d4256d6300 Keep following status when no key is pressed. 2015-04-08 21:25:31 -03:00
Hisham Muhammad
a93db5234c handle clicks on panel header line 2015-03-24 23:12:43 -03:00