aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2026-04-17 14:08:48 +0200
committerGitHub <noreply@github.com>2026-04-17 14:08:48 +0200
commitaa29cbaf6631af0afca6aae427a97b3e478393b3 (patch)
tree0ee1cab0f7bdc66cf151f38341252701338c1853 /src
parentfix(windows): skip modifier re-encoding for Char keys in cast_crossterm_key (... (diff)
downloadsl0ppij-aa29cbaf6631af0afca6aae427a97b3e478393b3.tar.gz
sl0ppij-aa29cbaf6631af0afca6aae427a97b3e478393b3.tar.xz
sl0ppij-aa29cbaf6631af0afca6aae427a97b3e478393b3.zip
Some idle CPU and disk/io fixes, new CommandChanged plugin Event (#5063)
* initial implementation * fix mouse cpu spam * prevent excess metadata write and prune sessions on startup * consolidate CommandChanged and PaneCommandChanged * tests * rustfmt * add pr
Diffstat (limited to 'src')
-rw-r--r--src/commands.rs18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/commands.rs b/src/commands.rs
index a86d1949..03151275 100644
--- a/src/commands.rs
+++ b/src/commands.rs
@@ -81,19 +81,31 @@ pub(crate) fn kill_all_sessions(yes: bool) {
}
pub(crate) fn delete_all_sessions(yes: bool, force: bool) {
+ use std::collections::BTreeMap;
+ use zellij_server::background_jobs::scan_session_list_default_dirs;
+
let active_sessions: Vec<String> = get_sessions()
.unwrap_or_default()
.iter()
.map(|s| s.0.clone())
.collect();
- let resurrectable_sessions = get_resurrectable_sessions();
+ let (_live_sessions, resurrectable_map) =
+ scan_session_list_default_dirs(&String::new(), &[], &BTreeMap::new());
+ let mut resurrectable_sessions: Vec<(String, Duration)> =
+ resurrectable_map.into_iter().collect();
+ if force {
+ for entry in get_resurrectable_sessions() {
+ if !resurrectable_sessions.iter().any(|(n, _)| *n == entry.0) {
+ resurrectable_sessions.push(entry);
+ }
+ }
+ }
let dead_sessions: Vec<_> = if force {
resurrectable_sessions
} else {
resurrectable_sessions
- .iter()
+ .into_iter()
.filter(|(name, _)| !active_sessions.contains(name))
- .cloned()
.collect()
};
if !yes {