Commit Graph

134 Commits

Author SHA1 Message Date
Daniel Lange
ce50095323 Merge branch 'fix-allBranchesCollapsed' of tanriol/htop 2022-05-30 10:37:19 +02:00
Denis Lisov
17e28d5264 actionExpandOrCollapseAllBranches: NOP in flat mode
This shortcut does not have any visible effect in flat mode, so disable
it completely to avoid possible confusion.
2022-05-30 10:52:12 +03:00
Benny Baumann
e053446cbd Fix typo, thx Explorer09 2022-05-21 10:24:42 +02:00
WHR
3d8fa0b926 Mark item separator in default color on help screen
Closes: #1014
2022-05-20 21:54:19 +02:00
Christian Hesse
d73cc70566 fix typo (dist -> disk)
This was changed in commit 37e01cbe33,
probably unintentional.
2022-05-20 12:58:12 +02:00
Benny Baumann
37e01cbe33 Colorize process state characters in help screen
Thanks to @Low-power for the idea
Closes #1010
2022-05-20 12:30:37 +02:00
WHR
d22667725a Call mousemask(3X) to truly enable or disable mouse control 2022-05-19 20:23:22 +02:00
Daniel Lange
fe7f238e2c Increasing niceness is also disabled by --readonly mode 2022-05-13 09:43:56 +02:00
Daniel Lange
8b98d3effb Document screen tab switching (TAB, Shift-TAB keys) 2022-04-30 17:06:59 +02:00
Denis Lisov
a3a7958721 ProcessList: sort before panel rebuild if needed 2022-02-13 19:50:16 +01:00
Kevin Bracey
4a664c0df8 Help: Linux swap consistency
On the help screen's depiction of the swap bar, the / separator between
used and cache should be coloured for consistency with the other bars.

I tried removing the coloured /s from the other bars to make them
consistent, but found that less visually appealing.
2022-01-13 19:45:01 +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
Christian Göttsche
ff4f44b22a Pre-select the last sent signal in SignalsPanel
Instead of pre-selecting SIGTERM every time, select the signal last
send in the same htop session.

Closes: #862
2021-12-05 19:36:36 +01:00
Daniel Lange
94ad111391 Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
Benny Baumann
6e6334e603 Simplify adding pages in one place 2021-08-22 16:15:59 +02:00
Christian Göttsche
68f2bfea61 Abstract resize handling by adding a new Htop reaction 2021-08-22 10:40:59 +02:00
Daniel Lange
a0c244a163 Spell out virtualized 2021-08-18 14:01:25 +02:00
Nathan Scott
d5ff5c48a8
Apply suggestions from code review
Co-authored-by: BenBE <BenBE@geshi.org>
2021-08-17 15:42:10 +10:00
Nathan Scott
c401ac3a98 Ensure DynamicColumn hash lookups never see NULL pointers
This cannot happen in these code locations, but for the purposes
of static checkers like Coverity scan (and for future proofing),
add two more guards on NULL hash table entry pointers.
2021-08-17 14:41:40 +10:00
Christian Göttsche
edafa26f9e Simplify Action_pickFromVector() width parameter usage
Pass one less instead of subtracting one inside the function.
2021-08-16 08:05:46 +02:00
Sohaib Mohamed
6f2021f3d9 PCP: support for 'dynamic columns' added at runtime
Implements support for arbitrary Performance Co-Pilot
metrics with per-process instance domains to form new
htop columns.  The column-to-metric mappings are setup
using configuration files which will be documented via
man pages as part of a follow-up commit.

We provide an initial set of column configurations so
as to provide new capabilities to pcp-htop: including
configs for containers, open fd counts, scheduler run
queue time, tcp/udp bytes/calls sent/recv, delay acct,
virtual machine guests, detailed virtual memory, swap.

Note there is a change to the configuration file path
resolution algorithm introduced for 'dynamic meters'.
First, look in any custom PCP_HTOP_DIR location.  Then
iterate, in priority order, users home directory, then
local sysadmins files in /etc/pcp/htop, then readonly
configuration files below /usr/share/pcp/htop.  This
final location becomes the preferred place for our own
shipped meter and column files.

The Settings file (htoprc) writing code is updated to
not using the numeric identifier for dynamic columns.
The same strategy used for dynamic meters is used here
where we write Dynamic(name) so the name can be setup
once more at start.  Regular (static) columns writing
to htoprc - i.e. numerically indexed - is unchanged.
2021-08-13 07:32:57 +02:00
Christian Göttsche
1fb0c720fe Enable affinity support for non-Linux
sched_getaffinity() and sched_setaffinity() are also available on BSDs.
Remove the Linux restraint.
2021-07-18 07:50:48 +02:00
Christian Göttsche
41af31be7f Rework CPU counting
Currently htop does not support offline CPUs and hot-swapping, e.g. via
    echo 0 > /sys/devices/system/cpu/cpu2/online

Split the current single cpuCount variable into activeCPUs and
existingCPUs.

Supersedes: #650
Related: #580
2021-07-18 07:44:02 +02:00
Benny Baumann
0d85af2872 Whitespace around operators 2021-07-15 06:57:24 +02:00
Benny Baumann
e7f8d7bcc9 Split statements that should go onto multiple lines 2021-07-15 06:57:24 +02:00
Benny Baumann
a75b99a15e Document '?' key to reach the help screen 2021-04-21 21:49:03 +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
David Zarzycki
3e8da0fcb6 Add MEMORY_SHARED to help screen 2021-03-24 19:30:28 +01:00
Christian Göttsche
16243a4a7e Action: merge conditions 2021-03-17 17:53:23 +01:00
Christian Göttsche
a4173f5209 Improve process following
- stay in follow mode on sort inversion (I)
- stay in follow mode after viewing help screen (h)
- select parent process (where available) when having followed a thread
  and hiding these (H)

Closes: #560
2021-03-14 14:47:15 +01:00
Christian Göttsche
59a150e8d7 Follow followed process when switching thread visibilities
Do not stop following a process when switching the visibility of
userland or kernel threads.

Related: #557
2021-03-03 20:06:14 +01:00
Daniel Lange
525d37d6a4 Shorten keyboard help to fit default screen width 2021-02-16 09:12:07 +01:00
Daniel Lange
2c6222e30a Option and key ("*") to collapse / expand all branches under PID 1
(and PID 2 if kernel threads are shown)

Based on hishamhm/htop#510 by Krishna Chaitanya, B
Closes #68
2021-02-13 16:47:04 +01:00
Daniel Lange
e86acd6893 Remove force sort order to ASC when returning to tree mode
Bug found by BenBE via IRC
2021-02-07 13:46:57 +01:00
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.
2021-02-05 14:12:49 +01:00
Christian Göttsche
211121f060 Drop invalid todo
The surrounding code has nothing to do with colors
2021-01-27 17:06:21 +01:00
David Zarzycki
37e186fd66 Linux: Add SwapCached to the swap meter
According to the Linux kernel documentation, "SwapCached" tracks "memory
that once was swapped out, is swapped back in but still also is
in the swapfile (if memory is needed it doesn't need to be swapped out
AGAIN because it is already in the swapfile. This saves I/O)."
2021-01-11 20:27:47 +01:00
Christian Göttsche
d72b0a682e Mark several non-modified pointer variables const 2021-01-11 20:12:34 +01:00
Christian Göttsche
8fe04b7494 Hashtable: use more distinct typename for key type 2021-01-06 16:59:28 +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
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
eb6f8d569d Action: drop resize callback
The supervising ScreenManager will resize all Panels
2021-01-04 23:12:43 +01:00
Christian Göttsche
f6aa5d29bb Action: remove trivial wrapper function 2021-01-01 21:31:30 +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
Jake Mannens
f46ddd3230 Remove 'n' and 'N' search inc/dec keybinds 2020-12-24 03:24:15 +11:00
Nathan Scott
737cd6167a Merge branch 'resize_bar' of https://github.com/cgzones/htop into cgzones-resize_bar 2020-12-22 15:25:08 +11:00
Daniel Lange
9b8b380c32 De-lazy @cgzones :) 2020-12-21 20:40:00 +01:00
Christian Göttsche
a09ad6b8b4 Action: sort key binding assignments
Avoid accidental duplicate usage.
2020-12-21 15:53:42 +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