fix(process): prevent zombie shell processes

This commit is contained in:
Andrei Ivanou 2026-05-17 16:41:25 +02:00 committed by Michael Murphy
parent 666f0110d6
commit 65a9e142b5

View file

@ -123,11 +123,15 @@ impl cosmic::Application for Button {
fn update(&mut self, message: Msg) -> app::Task<Msg> {
match message {
Msg::Press => {
let _ = Command::new("sh")
if let Ok(mut child) = Command::new("sh")
.arg("-c")
.arg(&self.desktop.exec)
.arg(format!("exec {}", self.desktop.exec))
.spawn()
.unwrap();
{
std::thread::spawn(move || {
let _ = child.wait();
});
}
}
Msg::ConfigUpdated(conf) => {
self.config = conf