From 60588bef46db6fcaa29c3bb1d164c31ba8e1fa21 Mon Sep 17 00:00:00 2001 From: vasilito Date: Tue, 7 Jul 2026 02:30:17 +0300 Subject: [PATCH] redbear-power: show process state counts in Process panel header [R:N S:N Z:N T:N] breakdown similar to htop's task summary, computed from the displayed process list. --- .../system/redbear-power/source/src/render.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/local/recipes/system/redbear-power/source/src/render.rs b/local/recipes/system/redbear-power/source/src/render.rs index 805c650b6c..eef16bedf6 100644 --- a/local/recipes/system/redbear-power/source/src/render.rs +++ b/local/recipes/system/redbear-power/source/src/render.rs @@ -1169,8 +1169,21 @@ pub fn render_process_panel<'a>(app: &'a App, focused: bool) -> Paragraph<'a> { } else { "\u{25BC}" }; + let mut running = 0u32; + let mut sleeping = 0u32; + let mut zombie = 0u32; + let mut stopped = 0u32; + for p in &proc.processes { + match p.state { + 'R' => running += 1, + 'Z' => zombie += 1, + 'T' | 't' => stopped += 1, + _ => sleeping += 1, + } + } + let state_summary = format!("R:{running} S:{sleeping} Z:{zombie} T:{stopped}"); lines.push(Line::from(format!( - "Showing top {} of {} process(es); total RSS: {}; sort: {} {}{}{} (press 'o' to cycle, 'y' for tree, 'F' to filter)", + "Showing top {} of {} process(es) [{state_summary}]; total RSS: {}; sort: {} {}{}{} (press 'o' to cycle, 'y' for tree, 'F' to filter)", proc.count(), proc.total_count, crate::process::ProcessInfo::format_memory_kb(proc.total_memory_kb),