Debian Codegraph @

docs/content/usage/widgets/process.md

raw symbols SCIP
1 # Process Widget
2
3 The process widget displays a table containing information regarding a running process, along with sorting,
4 searching, and process control features.
5
6 <figure>
7 <img src="../../../assets/screenshots/process/process_default.webp" alt="A picture of an expanded process widget by default."/>
8 </figure>
9
10 ## Features
11
12 The process widget has three main components:
13
14 - The main process table
15 - The search sub-widget (opened with ++ctrl+f++ or ++slash++)
16 - The sort menu sub-widget (opened with ++s++ or ++f6++)
17
18 By default, the main process table displays the following information for each process:
19
20 - PID
21 - Name of the process
22 - CPU use percentage (note this is averaged out per available thread by default)
23 - Memory use percentage
24 - Disk reads per second
25 - Disk writes per second
26 - Total amount read from disk
27 - Total amount written from disk
28 - User
29 - Process state
30 - Process uptime
31
32 <!-- 2-space indent here because mdx_truly_sane_lists interferes, see https://github.com/squidfunk/mkdocs-material/discussions/3763#discussioncomment-2833731 -->
33 !!! info indent
34
35 On Windows, the I/O counters will report _all_ reads/writes, not just disk. See
36 [here](https://docs.rs/sysinfo/latest/sysinfo/struct.Process.html#method.disk_usage)
37 for more details.
38
39 With the feature flag (`--disable_gpu` on Linux/Windows to disable) and gpu process columns enabled in the configuration:
40
41 - GPU memory use percentage
42 - GPU core utilization percentage
43
44 See [the processes configuration page](../../configuration/config-file/processes.md) on how to customize which columns
45 are shown.
46
47 ### Sorting
48
49 The table can be sorted by clicking on the table headers, which will either sort the table by that column, or if already
50 sorting by that column, reverse the sorting order.
51
52 Alternatively, one can sort using the sort menu sub-widget, which is brought up using ++s++ or ++f6++, and can be controlled by arrow keys or the mouse.
53
54 <figure>
55 <img src="../../../assets/screenshots/process/process_sort_menu.webp" alt="A picture of an expanded process widget with the sort menu open."/>
56 </figure>
57
58 ### Grouping
59
60 Pressing ++tab++ in the table will group entries with the same name together. The PID column will be replaced with the number of entries in each group, and usage
61 is added together when displayed.
62
63 <figure>
64 <img src="../../../assets/screenshots/process/process_grouped.webp" alt="A picture of grouped mode in a process widget."/>
65 </figure>
66
67 !!! Info
68
69 Note that the process state and user columns are disabled in this mode.
70
71 !!! Info
72
73 Note that if tree mode is also active, processes cannot be grouped together due to the behaviour of the two modes
74 somewhat clashing. This also reflects with default modes like `group_processes`.
75
76 ### Process termination
77
78 Pressing ++d+d++ or ++f9++ will allow you to terminate the currently selected process/process group. On Unix-like
79 operating systems, you are also able to control which specific signals to send (e.g. `SIGKILL`, `SIGTERM`).
80
81 <figure>
82 <img src="../../../assets/screenshots/process/process_kill_linux.webp" alt="A picture of the process kill menu on Linux."/>
83 <figcaption><sub>The process termination menu on Linux</sub></figcaption>
84 </figure>
85
86 If you're on Windows, or if the `disable_advanced_kill` flag is set in the options or command-line (only available on
87 Linux, macOS, and FreeBSD), then a simpler termination screen with just yes or no options will be shown.
88
89 <figure>
90 <img src="../../../assets/screenshots/process/process_kill_simple.webp" alt="A picture of the process kill menu on Windows."/>
91 <figcaption><sub>The process termination menu on Windows</sub></figcaption>
92 </figure>
93
94 ### Tree mode
95
96 Pressing ++t++ or ++f5++ in the table toggles tree mode in the process widget, displaying processes in regard to their parent-child process relationships.
97
98 <figure>
99 <img src="../../../assets/screenshots/process/process_tree.webp" alt="A picture of tree mode in a process widget."/>
100 </figure>
101
102 A process in tree mode can also be "collapsed", hiding its children and any descendants, using the either the ++minus++,
103 ++plus++, or ++left++ keys, or clicking on an entry. It can be expanded by using the ++minus++, ++plus++, or ++right++
104 keys, or by clicking on the entry again. The ++space++ key can also be used to toggle between the collapsed and expanded states.
105
106 !!! Info
107
108 Note that if tree mode is active, processes cannot be grouped together due to the behaviour of the two modes
109 somewhat clashing. This also reflects with default modes like `group_processes`.
110
111 ### Full command
112
113 You can show the full command instead of just the process name by pressing ++P++.
114
115 <figure>
116 <img src="../../../assets/screenshots/process/process_full.webp" alt="A picture of a process widget using full commands."/>
117 </figure>
118
119 ### Search
120
121 Pressing ++slash++ or ++ctrl+f++ will open up the search sub-widget. By default, just typing in something will search by the process name.
122
123 <figure>
124 <img src="../../../assets/screenshots/process/search/search.webp" alt="A picture of searching for a process with a simple search."/>
125 </figure>
126
127 This search can be further enhanced by matching by case, matching the entire word, or by regex.
128
129 <figure>
130 <img src="../../../assets/screenshots/process/search/regex.webp" alt="A picture of searching for a process with a search condition that uses regex."/>
131 </figure>
132
133 We are able to also search for multiple things/conditions.
134
135 <figure>
136 <img src="../../../assets/screenshots/process/search/or.webp" alt="A picture of searching for a process with a search condition that uses the or operator."/>
137 </figure>
138
139 And if our search uses a keyword, we need to use quotation marks around the term to properly search it.
140
141 <figure>
142 <img src="../../../assets/screenshots/process/search/quotes.webp" alt="A picture of searching for a process with a search condition that needs quotation marks."/>
143 </figure>
144
145 Lastly, we can refine our search even further based on the other columns, like PID, CPU usage, etc., as well as grouping together conditions.
146
147 <figure>
148 <img src="../../../assets/screenshots/process/search/cpu.webp" alt="A picture of searching for a process with a search condition that uses the CPU keyword."/>
149 </figure>
150
151 You can also paste search queries (e.g. ++shift+insert++, ++ctrl+shift+v++).
152
153 #### Keywords
154
155 Note all keywords are case-insensitive. To search for a process/command that collides with a keyword, surround the term with quotes (e.x. `"cpu"`).
156
157 | Keywords | Example | Description |
158 | ------------------------------- | ------------------------------------- | -------------------------------------------------------------------------------- |
159 | | `btm` | Matches by process or command name; supports regex |
160 | `pid` | `pid=1044` | Matches by PID; supports regex |
161 | `cpu` <br/> `cpu%` | `cpu > 0.5` | Matches the CPU column; supports comparison operators |
162 | `memb` | `memb > 1000 b` | Matches the memory column in terms of bytes; supports comparison operators |
163 | `mem` <br/> `mem%` | `mem < 0.5` | Matches the memory column in terms of percent; supports comparison operators |
164 | `read` <br/> `r/s` <br/> `rps` | `read = 1 mb` | Matches the read/s column in terms of bytes; supports comparison operators |
165 | `write` <br/> `w/s` <br/> `wps` | `write >= 1 kb` | Matches the write/s column in terms of bytes; supports comparison operators |
166 | `tread` <br/> `t.read` | `tread <= 1024 gb` | Matches the total read column in terms of bytes; supports comparison operators |
167 | `twrite` <br/> `t.write` | `twrite > 1024 tb` | Matches the total write column in terms of bytes; supports comparison operators |
168 | `user` | `user=root` | Matches by user; supports regex |
169 | `state` | `state=running` | Matches by state; supports regex |
170 | `()` | `(<COND 1> AND <COND 2>) OR <COND 3>` | Group together a condition |
171 | `gmem` | `gmem > 1000 b` | Matches the gpu memory column in terms of bytes; supports comparison operators |
172 | `gmem%` | `gmem% < 0.5` | Matches the gpu memory column in terms of percent; supports comparison operators |
173 | `gpu%` | `gpu% > 0` | Matches the gpu usage column in terms of percent; supports comparison operators |
174
175 #### Comparison operators
176
177 | Keywords | Description |
178 | -------- | -------------------------------------------------------------- |
179 | `=` | Checks if the values are equal |
180 | `!=` | Checks if the values are not equal |
181 | `>` | Checks if the left value is strictly greater than the right |
182 | `<` | Checks if the left value is strictly less than the right |
183 | `>=` | Checks if the left value is greater than or equal to the right |
184 | `<=` | Checks if the left value is less than or equal to the right |
185
186 #### Logical operators
187
188 Note all operators are case-insensitive, and the `and` operator takes precedence over the `or` operator.
189
190 | Keywords | Usage | Description |
191 | ------------------------------------ | ------------------------------------------------------------------------------ | --------------------------------------------------- |
192 | `and` <br/> `&&` <br/> `<Space>` | `<COND 1> and <COND 2>` <br/> `<COND 1> && <COND 2>` <br/> `<COND 1> <COND 2>` | Requires both conditions to be true to match |
193 | `or` <br/> <code>&#124;&#124;</code> | `<COND 1> or <COND 2>` <br/> `<COND 1> &#124;&#124; <COND 2>` | Requires at least one condition to be true to match |
194 | `!` | `!<COND>` <br/> `!(<COND 1> or <COND 2>)` | Inverts the following condition or group |
195
196 `!` is reserved as an operator, so it cannot appear bare as a value. To match a literal `!` in a name or string field, quote it — e.g. `"foo!"` or `user = "!"`. A bare `!` with nothing parseable after it (such as `user = !` or `!` on its own) is rejected.
197
198 #### Units
199
200 All units are case-insensitive.
201
202 | Keywords | Description |
203 | -------- | ----------- |
204 | `B` | Bytes |
205 | `KB` | Kilobytes |
206 | `MB` | Megabytes |
207 | `GB` | Gigabytes |
208 | `TB` | Terabytes |
209 | `KiB` | Kibibytes |
210 | `MiB` | Mebibytes |
211 | `GiB` | Gibibytes |
212 | `TiB` | Tebibytes |
213
214 ## Key bindings
215
216 Note that key bindings are generally case-sensitive.
217
218 ### Process table
219
220 | Binding | Action |
221 | --------------------------------------------------- | ---------------------------------------------------------------- |
222 | ++up++ , ++k++ | Move up within a widget |
223 | ++down++ , ++j++ | Move down within a widget |
224 | ++g+g++ , ++home++ | Jump to the first entry in the table |
225 | ++G++ , ++end++ | Jump to the last entry in the table |
226 | ++d+d++ , ++f9++ | Send a kill signal to the selected process |
227 | ++c++ | Sort by CPU usage, press again to reverse sorting order |
228 | ++m++ | Sort by memory usage, press again to reverse sorting order |
229 | ++p++ | Sort by PID name, press again to reverse sorting order |
230 | ++n++ | Sort by process name, press again to reverse sorting order |
231 | ++tab++ | Toggle grouping processes with the same name |
232 | ++P++ | Toggle between showing the full command or just the process name |
233 | ++ctrl+f++ , ++slash++ | Toggle showing the search sub-widget |
234 | ++s++ , ++f6++, ++delete++ (++fn+delete++ on macOS) | Toggle showing the sort sub-widget |
235 | ++I++ | Invert the current sort |
236 | ++"%"++ | Toggle between values and percentages for memory usage |
237 | ++t++ , ++f5++ | Toggle tree mode |
238 | ++M++ | Sort by gpu memory usage, press again to reverse sorting order |
239 | ++C++ | Sort by gpu usage, press again to reverse sorting order |
240 | ++z++ | Toggle the hiding of kernel threads |
241
242 ### Sort sub-widget
243
244 | Binding | Action |
245 | ------------------ | ------------------------------------- |
246 | ++up++ , ++k++ | Move up within a widget |
247 | ++down++ , ++j++ | Move down within a widget |
248 | ++g+g++ , ++home++ | Jump to the first entry in the table |
249 | ++G++ , ++end++ | Jump to the last entry in the table |
250 | ++esc++ | Close the sort sub-widget |
251 | ++enter++ | Sorts the corresponding process table |
252
253 ### Search sub-widget
254
255 | Binding | Action |
256 | ------------------------------------- | -------------------------------------------- |
257 | ++left++ <br/> ++h++ <br/> ++alt+h++ | Moves the cursor left |
258 | ++right++ <br/> ++l++ <br/> ++alt+l++ | Moves the cursor right |
259 | ++esc++ | Close the search widget (retains the filter) |
260 | ++ctrl+a++ | Skip to the start of the search query |
261 | ++ctrl+e++ | Skip to the end of the search query |
262 | ++ctrl+u++ | Clear the current search query |
263 | ++ctrl+w++ | Delete a word behind the cursor |
264 | ++ctrl+h++ | Delete the character behind the cursor |
265 | ++backspace++ | Delete the character behind the cursor |
266 | ++delete++ (++fn+delete++ on macOS) | Delete the character at the cursor |
267 | ++alt+c++ , ++f1++ | Toggle matching case |
268 | ++alt+w++ , ++f2++ | Toggle matching the entire word |
269 | ++alt+r++ , ++f3++ | Toggle using regex |
270
271 ## Mouse bindings
272
273 ### Process table
274
275 | Binding | Action |
276 | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
277 | ++"Scroll"++ | Selects a CPU thread/average to show in the graph |
278 | ++lbutton++ | Table header: Sorts/reverse sorts the table by the column <br/> Table entry: Selects an entry in the table, if in tree mode, collapses/expands the entry's children |
279
280 ### Sort sub-widget
281
282 | Binding | Action |
283 | ----------- | ----------------------------- |
284 | ++lbutton++ | Selects an entry in the table |