Skip to content

A treemap for finding and removing what fills your disk, for Omarchy. Rust + GPUI.

Rust

Merge remote-tracking branch 'origin/pr/23' into straightforward-followups

Tobi Lutke61a09f39c5f4
diff --cc crates/disktree-app/src/main.rs
index b5e1ca8,8f5e187..761e331
--- a/crates/disktree-app/src/main.rs
+++ b/crates/disktree-app/src/main.rs
@@@ -73,7 -79,31 +79,31 @@@ fn main() -> Result<()>
}
fn run() -> Result<()> {
- let args = parse_args()?;
+ let args = parse_args(std::env::args_os().skip(1))?;
+
+ // When the app executable is reached through the command-line symlink,
+ // cmux sends SIGTERM to its foreground process group as AppKit takes
+ // focus. Spawn once into a separate group before AppKit starts. Restrict
+ // this to interactive cmux sessions so scripts retain normal foreground
+ // lifetime; the marker prevents the child from spawning recursively.
+ #[cfg(target_os = "macos")]
+ if std::io::stdin().is_terminal()
+ && std::env::var_os("CMUX_SURFACE_ID").is_some()
+ && std::env::var_os("DISKTREE_CMUX_DETACHED").is_none()
+ {
+ Command::new(std::env::current_exe().context("find disktree")?)
+ .args(std::env::args_os().skip(1))
+ .env("DISKTREE_CMUX_DETACHED", "1")
+ .stdin(Stdio::null())
+ .stdout(Stdio::null())
+ .stderr(Stdio::null())
+ // Zero makes the child the leader of a new process group.
+ .process_group(0)
+ .spawn()
+ .context("start disktree")?;
+ return Ok(());
+ }
+
let root = args.root.clone();
let depth = args.depth;
let title_root = root.clone();