Expand description
Shared formatting utilities used across commands and output
Provides common string formatting, truncation, and colorization.
Structs§
- Process
Table Budget - What the three flexible process-table columns may use at a given terminal width, once the fixed columns are accounted for.
Functions§
- colorize_
status - Colorize a process status string based on the status variant.
- format_
duration - Format a duration in seconds to a human-readable string.
- format_
memory - Format memory in MB to a human-readable string with adaptive units.
- plural
- Return “es” for plural process counts, “” for singular.
- process_
table_ budget - Column budget for a process table rendered at
widthterminal columns. - truncate_
path - Truncate a path to
max_widthterminal columns, eliding the middle. - truncate_
string - Truncate
stomax_widthterminal columns, appending…when cut. - uptime_
label - Uptime as a trailing label for one-line process views (tree, why):
" up 3m 12s", or empty when unknown.