Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package zenith for openSUSE:Factory checked in at 2026-09-08 16:54:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/zenith (Old) and /work/SRC/openSUSE:Factory/.zenith.new.1265 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "zenith" Tue Sep 8 16:54:49 2026 rev:5 rq:1376123 version:0.15.1 Changes: -------- --- /work/SRC/openSUSE:Factory/zenith/zenith.changes 2026-05-12 19:31:35.563331525 +0200 +++ /work/SRC/openSUSE:Factory/.zenith.new.1265/zenith.changes 2026-09-08 16:56:41.584421614 +0200 @@ -1,0 +2,11 @@ +Mon Sep 07 07:48:22 UTC 2026 - Alessio Biancalana <[email protected]> + +- Update to version 0.15.1: + * fix: update starship-battery dependency + * chore: version -> 0.15.1 + * lint: cargo clippy + * feat: faster event processing + * Fix show temp (#188) + * fix: correct Unkown→Unknown typo in NVIDIA error message + +------------------------------------------------------------------- Old: ---- zenith-0.15.0.tar.zst New: ---- zenith-0.15.1.tar.zst ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ zenith.spec ++++++ --- /var/tmp/diff_new_pack.PB6Qiu/_old 2026-09-08 16:56:46.035608083 +0200 +++ /var/tmp/diff_new_pack.PB6Qiu/_new 2026-09-08 16:56:46.038608208 +0200 @@ -17,7 +17,7 @@ Name: zenith -Version: 0.15.0 +Version: 0.15.1 Release: 0 Summary: Sort of like top or htop but with zoom-able charts License: MIT ++++++ _service ++++++ --- /var/tmp/diff_new_pack.PB6Qiu/_old 2026-09-08 16:56:46.075609758 +0200 +++ /var/tmp/diff_new_pack.PB6Qiu/_new 2026-09-08 16:56:46.079609926 +0200 @@ -3,7 +3,7 @@ <param name="url">https://github.com/bvaisvil/zenith.git</param> <param name="versionformat">@PARENT_TAG@</param> <param name="scm">git</param> - <param name="revision">0.15.0</param> + <param name="revision">0.15.1</param> <param name="match-tag">*</param> <param name="versionrewrite-pattern">v(\d+\.\d+\.\d+)</param> <param name="versionrewrite-replacement">\1</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.PB6Qiu/_old 2026-09-08 16:56:46.105611015 +0200 +++ /var/tmp/diff_new_pack.PB6Qiu/_new 2026-09-08 16:56:46.110611225 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/bvaisvil/zenith.git</param> - <param name="changesrevision">e99775a1c0ecd193943fa2090240c6b75da6c3aa</param></service></servicedata> + <param name="changesrevision">00247ba496fc1e9eb6d4c3e7d12ff56c23b0190a</param></service></servicedata> (No newline at EOF) ++++++ vendor.tar.zst ++++++ /work/SRC/openSUSE:Factory/zenith/vendor.tar.zst /work/SRC/openSUSE:Factory/.zenith.new.1265/vendor.tar.zst differ: char 7, line 1 ++++++ zenith-0.15.0.tar.zst -> zenith-0.15.1.tar.zst ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zenith-0.15.0/Cargo.lock new/zenith-0.15.1/Cargo.lock --- old/zenith-0.15.0/Cargo.lock 2026-05-08 22:50:11.000000000 +0200 +++ new/zenith-0.15.1/Cargo.lock 2026-09-02 19:04:24.000000000 +0200 @@ -300,6 +300,15 @@ ] [[package]] +name = "block2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" +dependencies = [ + "objc2", +] + +[[package]] name = "blocking" version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -415,9 +424,9 @@ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cfg_aliases" @@ -436,7 +445,7 @@ "js-sys", "num-traits", "wasm-bindgen", - "windows-link", + "windows-link 0.1.3", ] [[package]] @@ -484,16 +493,6 @@ ] [[package]] -name = "core-foundation" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] name = "core-foundation-sys" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -591,12 +590,9 @@ [[package]] name = "deranged" -version = "0.4.0" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" -dependencies = [ - "powerfmt", -] +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" [[package]] name = "dirs-next" @@ -620,6 +616,17 @@ ] [[package]] +name = "dispatch2" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" +dependencies = [ + "bitflags 2.9.0", + "block2", + "objc2", +] + +[[package]] name = "either" version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -950,7 +957,7 @@ source = "git+https://github.com/bvaisvil/heim.git?branch=zenith_changes#f8a384aceff44e1da490bddaf615ca3272256ede" dependencies = [ "cfg-if", - "core-foundation 0.9.4", + "core-foundation", "futures-core", "futures-util", "lazy_static", @@ -987,7 +994,7 @@ dependencies = [ "bitflags 1.3.2", "cfg-if", - "core-foundation 0.9.4", + "core-foundation", "heim-common", "heim-runtime", "libc", @@ -1253,9 +1260,9 @@ [[package]] name = "libc" -version = "0.2.179" +version = "0.2.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5a2d376baa530d1238d133232d15e239abad80d05838b4b59354e5268af431f" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" [[package]] name = "libloading" @@ -1344,12 +1351,9 @@ [[package]] name = "mach2" -version = "0.4.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" -dependencies = [ - "libc", -] +checksum = "dae608c151f68243f2b000364e1f7b186d9c29845f7d2d85bd31b9ad77ad552b" [[package]] name = "memchr" @@ -1419,9 +1423,9 @@ [[package]] name = "nix" -version = "0.29.0" +version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" dependencies = [ "bitflags 2.9.0", "cfg-if", @@ -1459,9 +1463,9 @@ [[package]] name = "num-conv" -version = "0.1.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" [[package]] name = "num-derive" @@ -1527,21 +1531,44 @@ ] [[package]] +name = "objc2" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f" +dependencies = [ + "objc2-encode", +] + +[[package]] name = "objc2-core-foundation" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ "bitflags 2.9.0", + "block2", + "dispatch2", + "libc", + "objc2", ] [[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] name = "objc2-io-kit" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33fafba39597d6dc1fb709123dfa8289d39406734be322956a69f0931c73bb15" dependencies = [ + "bitflags 2.9.0", + "block2", + "dispatch2", "libc", + "objc2", "objc2-core-foundation", ] @@ -1626,9 +1653,9 @@ [[package]] name = "plist" -version = "1.7.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" +checksum = "7da1d65da6dd5d1e44199ac0f58712d241c0f439f80adea8924d832384087f85" dependencies = [ "base64", "indexmap", @@ -1758,9 +1785,9 @@ [[package]] name = "quick-xml" -version = "0.32.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" +checksum = "e660451e55124f798a69a5af3f49ccfbefbd41910eefd25caf2393e1f3473ec1" dependencies = [ "memchr", ] @@ -2002,22 +2029,32 @@ [[package]] name = "serde" -version = "1.0.219" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 3.0.4", ] [[package]] @@ -2118,20 +2155,21 @@ [[package]] name = "starship-battery" -version = "0.10.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce0bc92586a2cba9cd189520c457b95e50f5565c3011484a5c83949be2f9fdcc" +checksum = "e919b7ecd99f2d5ed9efdc8d242ae93d91684181a782dadcbcd72079930155f9" dependencies = [ "cfg-if", - "core-foundation 0.10.0", "lazycell", "libc", "mach2", - "nix 0.29.0", + "nix 0.31.3", "num-traits", + "objc2-core-foundation", + "objc2-io-kit", "plist", - "uom 0.36.0", - "windows-sys 0.59.0", + "uom 0.38.0", + "windows-sys 0.61.2", ] [[package]] @@ -2191,6 +2229,17 @@ ] [[package]] +name = "syn" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6275cddf4610d1775e6d1fe9469b2e77d0f39fd98fb7450901b821e0c53649f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] name = "sysinfo" version = "0.37.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2232,30 +2281,29 @@ [[package]] name = "time" -version = "0.3.40" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9c75b47bdff86fa3334a3db91356b8d7d86a9b839dab7d0bdc5c3d3a077618" +checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134" dependencies = [ "deranged", - "itoa", "num-conv", "powerfmt", - "serde", + "serde_core", "time-core", "time-macros", ] [[package]] name = "time-core" -version = "0.1.4" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" [[package]] name = "time-macros" -version = "0.2.21" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29aa485584182073ed57fd5004aa09c371f021325014694e432313345865fd04" +checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85" dependencies = [ "num-conv", "time-core", @@ -2363,9 +2411,9 @@ [[package]] name = "uom" -version = "0.36.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffd36e5350a65d112584053ee91843955826bf9e56ec0d1351214e01f6d7cd9c" +checksum = "a739f83872836c82a4f2527d4e54b37007b3de68cafe7edde95fd695968bf4b9" dependencies = [ "num-traits", "typenum", @@ -2518,7 +2566,7 @@ "windows-collections", "windows-core 0.61.2", "windows-future", - "windows-link", + "windows-link 0.1.3", "windows-numerics", ] @@ -2548,7 +2596,7 @@ dependencies = [ "windows-implement", "windows-interface", - "windows-link", + "windows-link 0.1.3", "windows-result", "windows-strings", ] @@ -2560,7 +2608,7 @@ checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" dependencies = [ "windows-core 0.61.2", - "windows-link", + "windows-link 0.1.3", "windows-threading", ] @@ -2593,13 +2641,19 @@ checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" [[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] name = "windows-numerics" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" dependencies = [ "windows-core 0.61.2", - "windows-link", + "windows-link 0.1.3", ] [[package]] @@ -2608,7 +2662,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ - "windows-link", + "windows-link 0.1.3", ] [[package]] @@ -2617,7 +2671,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" dependencies = [ - "windows-link", + "windows-link 0.1.3", ] [[package]] @@ -2648,6 +2702,15 @@ ] [[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] name = "windows-targets" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2684,7 +2747,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" dependencies = [ - "windows-link", + "windows-link 0.1.3", ] [[package]] @@ -2809,7 +2872,7 @@ [[package]] name = "zenith" -version = "0.15.0" +version = "0.15.1" dependencies = [ "bincode", "byte-unit", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zenith-0.15.0/Cargo.toml new/zenith-0.15.1/Cargo.toml --- old/zenith-0.15.0/Cargo.toml 2026-05-08 22:50:11.000000000 +0200 +++ new/zenith-0.15.1/Cargo.toml 2026-09-02 19:04:24.000000000 +0200 @@ -1,6 +1,6 @@ [package] name = "zenith" -version = "0.15.0" +version = "0.15.1" authors = ["Benjamin Vaisvil"] edition = "2018" description = "Similar to top or htop but with CPU, Network Usage, and Disk Usage charts." @@ -35,7 +35,7 @@ serde_derive = "~1.0.217" flate2 = "1.0.35" bincode = "1.3.3" -starship-battery = "0.10.*" +starship-battery = "0.11.*" signal-hook = "~0.3.17" log = "~0.4.22" env_logger = { version = "~0.11.6", default-features = false } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zenith-0.15.0/src/metrics/histogram.rs new/zenith-0.15.1/src/metrics/histogram.rs --- old/zenith-0.15.0/src/metrics/histogram.rs 2026-05-08 22:50:11.000000000 +0200 +++ new/zenith-0.15.1/src/metrics/histogram.rs 2026-09-02 19:04:24.000000000 +0200 @@ -104,7 +104,7 @@ .duration_since(previous_stop) .expect("Current time is before stored time. This should not happen."); let week_ticks = ONE_WEEK / hm.tick.as_secs(); - for (_k, v) in hm.map.iter_mut() { + for v in hm.map.values_mut() { let data = v.data.to_mut(); if data.len() as u64 > week_ticks { let end = data.len() as u64 - week_ticks; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zenith-0.15.0/src/renderer/cpu.rs new/zenith-0.15.1/src/renderer/cpu.rs --- old/zenith-0.15.0/src/renderer/cpu.rs 2026-05-08 22:50:11.000000000 +0200 +++ new/zenith-0.15.1/src/renderer/cpu.rs 2026-09-02 19:04:24.000000000 +0200 @@ -36,7 +36,9 @@ 0 => 0, _ => histogram.iter().max().unwrap_or(&0).to_owned(), }; - let temp = if !app.sensors.is_empty() { + // Build TEMP spans conditionally - if no sensors, returns empty vec + // so "TEMP []" doesn't appear in the title bar + let temp_spans: Vec<Span> = if !app.sensors.is_empty() { let t = app .sensors .iter() @@ -53,17 +55,24 @@ .map(|s| s.current_temp as f64) .fold(f64::MIN, f64::max); - if max_temp > hot_threshold { + // Style the temperature number based on how hot it is + let colored = if max_temp > hot_threshold { Span::styled(numbers_txt, max_style()) } else if max_temp < cold_threshold { Span::styled(numbers_txt, Style::default().fg(Color::Cyan)) } else { Span::raw(numbers_txt) - } + }; + + // Return all three spans so brackets only appear when there are sensors + vec![Span::raw(" TEMP ["), colored, Span::raw("]")] } else { - Span::raw(String::from("")) + vec![] }; - Line::from(vec![ + + // Build the title spans incrementally so TEMP section can be + // conditionally included via extend + let mut spans = vec![ Span::raw("CPU ["), Span::styled( format!("{: >3}%", app.cpu_utilization), @@ -74,23 +83,26 @@ }, ), Span::raw("]"), - Span::raw(" TEMP ["), - temp, - Span::raw("]"), + ]; + if !temp_spans.is_empty() { + spans.extend(temp_spans); + } + spans.extend([ Span::raw(" MEAN ["), Span::styled( - format!("{mean: >3.2}%",), + format!("{mean: >3.2}%"), if mean > 90.0 { max_style() } else { ok_style() }, ), Span::raw("] PEAK ["), Span::styled( - format!("{peak: >3.2}%",), + format!("{peak: >3.2}%"), if peak > 90 { max_style() } else { ok_style() }, ), Span::raw(format!( "] TOP [{top_pid} - {top_process_name} - {top_process_amt}]" )), - ]) + ]); + Line::from(spans) } fn mem_title(app: &'_ CPUTimeApp) -> Line<'_> { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zenith-0.15.0/src/renderer/help.rs new/zenith-0.15.1/src/renderer/help.rs --- old/zenith-0.15.0/src/renderer/help.rs 2026-05-08 22:50:11.000000000 +0200 +++ new/zenith-0.15.1/src/renderer/help.rs 2026-09-02 19:04:24.000000000 +0200 @@ -102,7 +102,7 @@ let content = match ne { NvmlError::DriverNotLoaded => "NVIDIA Error: No Driver Detected.", NvmlError::NoPermission => "NVIDIA Error: Permissioned denied to talk to driver.", - NvmlError::Unknown => "NVIDIA Error: Unkown Error.", + NvmlError::Unknown => "NVIDIA Error: Unknown Error.", _ => "", }; if !content.is_empty() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zenith-0.15.0/src/renderer/mod.rs new/zenith-0.15.1/src/renderer/mod.rs --- old/zenith-0.15.0/src/renderer/mod.rs 2026-05-08 22:50:11.000000000 +0200 +++ new/zenith-0.15.1/src/renderer/mod.rs 2026-09-02 19:04:24.000000000 +0200 @@ -30,6 +30,7 @@ use std::io::Stdout; use std::path::PathBuf; use std::rc::Rc; +use std::sync::mpsc::TryRecvError; use std::time::{Duration, Instant}; use ratatui::layout::{Constraint, Direction, Layout, Rect}; @@ -463,6 +464,38 @@ } } + async fn handle_event(&mut self, event: Event<KeyEvent>) -> Action { + match event { + Event::Input(input) => { + let process_table = + process::filter_process_table(&self.app, &self.filter).into_owned(); + + if !process_table.is_empty() && self.highlighted_row >= process_table.len() { + self.highlighted_row = process_table.len() - 1; + } + self.process_key_event(input, &process_table, self.process_table_height) + .await + } + Event::Resize(_, height) => { + self.constraints = get_constraints(&self.section_geometry, height); + Action::Continue + } + Event::Tick => { + self.process_tick().await; + Action::Continue + } + Event::Save => { + debug!("Event Save"); + self.app.save_state().await; + Action::Continue + } + Event::Terminate => { + debug!("Event Terminate"); + Action::Quit + } + } + } + pub async fn start(&mut self, mut terminal: Terminal<CrosstermBackend<Stdout>>) { debug!("Starting Main Loop."); if self.recompute_constraints_on_start_up { @@ -473,40 +506,28 @@ terminal .draw(|f| self.render_frame(f)) .expect("Could not draw frame."); - - let process_table = process::filter_process_table(&self.app, &self.filter); - - if !process_table.is_empty() && self.highlighted_row >= process_table.len() { - self.highlighted_row = process_table.len() - 1; + // block waiting for the first event + let event = self + .events + .next() + .expect("Event channel closed unexpectedly."); + let action = self.handle_event(event).await; + if let Action::Quit = action { + return; } - let event = self.events.next().expect("No new event."); - let action = match event { - Event::Input(input) => { - let process_table = process_table.into_owned(); - self.process_key_event(input, &process_table, self.process_table_height) - .await - } - Event::Resize(_, height) => { - self.constraints = get_constraints(&self.section_geometry, height); - Action::Continue - } - Event::Tick => { - self.process_tick().await; - Action::Continue - } - Event::Save => { - debug!("Event Save"); - self.app.save_state().await; - Action::Continue - } - Event::Terminate => { - debug!("Event Terminate"); - Action::Quit + // then process all subsequent events + loop { + match self.events.try_next() { + Ok(event) => { + let action = self.handle_event(event).await; + match action { + Action::Quit => return, + Action::Continue => {} + } + } + Err(TryRecvError::Empty) => break, // no event break out of loop + Err(TryRecvError::Disconnected) => return, } - }; - match action { - Action::Quit => break, - Action::Continue => {} } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zenith-0.15.0/src/renderer/process.rs new/zenith-0.15.1/src/renderer/process.rs --- old/zenith-0.15.0/src/renderer/process.rs 2026-05-08 22:50:11.000000000 +0200 +++ new/zenith-0.15.1/src/renderer/process.rs 2026-09-02 19:04:24.000000000 +0200 @@ -44,7 +44,7 @@ .expect("expected pid to be present") }) .collect(); - let highlighted_process = if !procs.is_empty() { + let highlighted_process = if !procs.is_empty() && procs.len() > highlighted_row { Some(Box::new(procs[highlighted_row].clone())) } else { None @@ -322,12 +322,12 @@ let mut text = vec![ Line::from(vec![ Span::raw("Name: "), - Span::styled(format!("{:} ({:})", &p.name, alive), rhs_style), + Span::styled(format!("{:} ({:})", p.name, alive), rhs_style), ]), Line::from(vec![ Span::raw("PID: "), Span::styled( - format!("{:>width$}", &p.pid, width = app.max_pid_len), + format!("{:>width$}", p.pid, width = app.max_pid_len), rhs_style, ), ]), @@ -358,14 +358,14 @@ Span::styled( format!( "{:>7.2} % (Peak: {:>7.2} %)", - &p.cpu_usage, &p.peak_cpu_usage + p.cpu_usage, p.peak_cpu_usage ), rhs_style, ), ]), Line::from(vec![ Span::raw("Threads: "), - Span::styled(format!("{:>7}", &p.threads_total), rhs_style), + Span::styled(format!("{:>7}", p.threads_total), rhs_style), ]), Line::from(vec