Christian Göttsche
fd4e6b432b
Use MainPanel type in State struct
...
The State struct holds a pointer to the main process panel.
Use the distinct MainPanel type, to improve maintainability regrading
its usage.
This avoids usages of down-casts from Panel to MainPanel, only up-casts
from MainPanel to Panel are now required.
5 years ago
Daniel Lange
12f5f06e88
Check for sortTimeout to not run towards -inf
...
Seems to happen on Mac OS "Big Sur" (~forced application sleep)
Partial fix for #510
5 years ago
Christian Göttsche
d72b0a682e
Mark several non-modified pointer variables const
5 years ago
Daniel Lange
2ba8a81d47
Fix clearing the last line in setup on function bar change (thanks cgzones)
5 years ago
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
5 years ago
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.
5 years ago
Christian Göttsche
86d2931255
Restore highlighted header of current sorted process column
5 years ago
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
5 years ago
Daniel Lange
7b739b6292
Fix pause mode ("Z") in tree view
5 years ago
Benny Baumann
c49ca61dd9
Common order for ESC/q/F10
5 years ago
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.
5 years ago
Nathan Scott
fee217551c
Drop unneeded parameters to the ScreenManager constructor
...
All calls to ScreenManager_new always pass the same first
five values, the orientation is always HORIZONTAL and the
y1 parameter is always the height of the passed-in header
struct pointer. I think its safe to assert at this point
that no VERTICAL orientation will arrive (if it does, its
no harm in re-adding this then) - so we can remove unused
conditionals (and TODOs) based on orientation too.
5 years ago
Benny Baumann
45869513bf
Embracing branches
5 years ago
Benny Baumann
61e14d4bb2
Spacing around operators
5 years ago
Adam Saponara
dde71c6637
Highlight new and old processes ( #74 )
5 years ago
Christian Göttsche
96e2a4259e
Continue to update generic data in paused mode
...
Generic data, as CPU and memory usage, are used by Meters.
In paused mode they would stop receiving updates and especially Graph
Meters would stop showing continuous data.
Improves: #214
Closes : #253
5 years ago
Benny Baumann
0f5262917f
Make all required includes explicit
...
Information as seen by IWYU 0.12 + clang 9 on Linux
5 years ago
Christian Göttsche
b47bc667a2
Add key to pause process list updates
5 years ago
Daniel Lange
079c2abf8e
Update License consistently to GPLv2 as per COPYING file
6 years ago
Christian Göttsche
18b1e9fba9
Do not drop qualifier in cast
...
ListItem.c:73:33: warning: cast from 'const void *' to 'struct ListItem_ *' drops const qualifier [-Wcast-qual]
ListItem* obj1 = (ListItem*) cast1;
^
ListItem.c:74:33: warning: cast from 'const void *' to 'struct ListItem_ *' drops const qualifier [-Wcast-qual]
ListItem* obj2 = (ListItem*) cast2;
^
Process.c:434:28: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual]
Process* p1 = (Process*)v1;
^
Process.c:435:28: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual]
Process* p2 = (Process*)v2;
^
Process.c:441:36: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual]
Settings *settings = ((Process*)v1)->settings;
^
Process.c:443:22: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual]
p1 = (Process*)v1;
^
Process.c:444:22: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual]
p2 = (Process*)v2;
^
Process.c:446:22: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual]
p2 = (Process*)v1;
^
Process.c:447:22: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual]
p1 = (Process*)v2;
^
AffinityPanel.c:37:16: warning: cast from 'const char *' to 'void *' drops const qualifier [-Wcast-qual]
free((void*)this->text);
^
AffinityPanel.c:39:19: warning: cast from 'const char *' to 'void *' drops const qualifier [-Wcast-qual]
free((void*)this->indent);
^
linux/LinuxProcess.c:294:36: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual]
Settings *settings = ((Process*)v1)->settings;
^
linux/LinuxProcess.c:296:27: warning: cast from 'const void *' to 'struct LinuxProcess_ *' drops const qualifier [-Wcast-qual]
p1 = (LinuxProcess*)v1;
^
linux/LinuxProcess.c:297:27: warning: cast from 'const void *' to 'struct LinuxProcess_ *' drops const qualifier [-Wcast-qual]
p2 = (LinuxProcess*)v2;
^
linux/LinuxProcess.c:299:27: warning: cast from 'const void *' to 'struct LinuxProcess_ *' drops const qualifier [-Wcast-qual]
p2 = (LinuxProcess*)v1;
^
linux/LinuxProcess.c:300:27: warning: cast from 'const void *' to 'struct LinuxProcess_ *' drops const qualifier [-Wcast-qual]
p1 = (LinuxProcess*)v2;
^
linux/LinuxProcessList.c:62:32: warning: cast from 'const void *' to 'struct TtyDriver_ *' drops const qualifier [-Wcast-qual]
TtyDriver* a = (TtyDriver*) va;
^
linux/LinuxProcessList.c:63:32: warning: cast from 'const void *' to 'struct TtyDriver_ *' drops const qualifier [-Wcast-qual]
TtyDriver* b = (TtyDriver*) vb;
^
linux/Battery.c:130:21: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]
free((char *) isOnline);
^
linux/Battery.c:197:26: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]
xSnprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/type", entryName);
^
linux/Battery.c:209:29: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]
xSnprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/uevent", entryName);
^
linux/Battery.c:262:29: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]
xSnprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/online", entryName);
^
6 years ago
Nathan Scott
c9ecd0fa74
Revert the vim_mode setting for now, needs a rethink
...
There have been too many bugs reported in vim_mode, and
the proposed fixes are increasingly fragile - hence we
have decided to back it out for now. For reference:
https://github.com/htop-dev/htop/issues/69
https://github.com/htop-dev/htop/pull/37
https://github.com/htop-dev/htop/pull/106
The whitespace changes also arrived in commit 12805f61d
not sure what that was about, but backed out as well.
6 years ago
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.
6 years ago
Daniel Flanagan
dd33444f7e
Clean up existing whitespace
6 years ago
Daniel Flanagan
12805f61d8
Add simple vim mode
...
This commit adds a "vim_mode" setting (false/`0` by default) that causes
keys to be remapped in the following way by the `ScreenManager`:
+ h -> LEFT
+ j -> DOWN
+ k -> UP
+ l -> RIGHT
+ LEFT -> h (toggle help)
+ DOWN -> j (noop)
+ UP -> k (open kill menu)
+ RIGHT -> l (lsof current process)
+ K (Shift+K) -> k (open kill menu)
+ J (Shift+J) -> K (toggle show/hide kernel threads)
+ L (Shift+L) -> l (lsof current process)
I couldn't figure out where the manpage documentation is in the repo,
though I admittedly did not look particularly hard.
I believe this change would be a welcome option for heavy vim users like myself
who would like a familiar way to get around in htop.
6 years ago
MartinJM
b0e24cd5a5
Added an option to disable the mouse.
7 years ago
Alan Barr
79c939eb84
Remove duplicated if condition
...
The for loop already handles i being < nPanels
Raised by cppcheck
7 years ago
Alan Barr
c39f710b52
Remove duplicated if condition
...
The for loop already handles i being < nPanels
Raised by cppcheck
7 years ago
Hisham
0128d222b9
Added Ctrl+A and Ctrl+E to go to beginning and end of line.
...
(Also, '^' and '$')
Closes #508 .
10 years ago
Hisham
645057d81a
Use set_escdelay() to avoid problems with ESCDELAY as a macro.
10 years ago
Hisham
c23d4f12d1
Fix behavior of ESC key, getting rid of the annoying delay.
...
Thank you @Explorer09 for the push!
Closes #417 .
10 years ago
Hisham
b54d2dde40
Check for failure in allocations.
10 years ago
Michael Klein
99b947058f
vi keys: translate ALT-h/j/k/l to arrow keys
10 years ago
Hisham Muhammad
78be8201dc
Add expand/collapse on additional clicks!
11 years ago
Hisham Muhammad
b003636958
Support for NCurses 6.0 and mouse wheel
11 years ago
Hisham Muhammad
a93db5234c
handle clicks on panel header line
11 years ago
Hisham Muhammad
ade7993fcb
incremental search and filter reintegrated!
11 years ago
Hisham Muhammad
d0c72c3fb2
Move FunctionBar inside Panel
11 years ago
Hisham Muhammad
1084a3ff8f
Working on integration of IncSet in new branch.
11 years ago
Hisham Muhammad
09c7152990
Refactor state control variables.
11 years ago
Hisham Muhammad
6f868b00c0
Fix allocation of processes. Closes #166 .
11 years ago
Hisham Muhammad
d7c843c23b
Complete cursor-based movement of headers.
11 years ago
Hisham Muhammad
c2108e5a48
Another mega-patch for the refactoring process.
...
Kinda runs, but functionality from the original main loop
is still missing. Patience.
11 years ago
Hisham Muhammad
3383d8e556
Sorry about the mega-patch.
...
This is a work-in-progress, code is currently broken.
(Some actions, and notably, the header, are missing.)
11 years ago
Hisham Muhammad
9faf4938b8
Refactored key handlers.
...
Made the logic more modular, hopefully easier to follow,
and removed repeated code.
Plus, some optimization in RichString code.
11 years ago
Hisham Muhammad
ee5dc46fee
Don't end up killing init if process selected to be killed terminates before the user selects a signal. Closes #3606072 .
13 years ago
Hisham Muhammad
00b324bfc1
Changes in object model: separate class objects to store vtable. Also, nicer UTF-8 display of big numbers.
13 years ago
Hisham Muhammad
2a73405cd0
search and filter for the strace and lsof screens!
14 years ago
Hisham Muhammad
45f7a4fc8d
Remove old memory debugging routines. We have Valgrind nowadays.
14 years ago
Hisham Muhammad
84281bdc44
major header cleanup
14 years ago
Hisham Muhammad
bfd86a60cc
Keep panel structure up-to-date as process list changes when headers are updated during the screen manager. Hopefully closes #3444533 .
14 years ago