Skip to content

Commit 8b5ceab

Browse files
committed
Fix spawn_terminal on non-flatpak hosts
fixes #15
1 parent 51442c0 commit 8b5ceab

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/store/root_store.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ impl RootStore {
164164
self.imp().distrobox.get().unwrap()
165165
}
166166

167+
pub fn command_runner(&self) -> Rc<dyn crate::distrobox::CommandRunner> {
168+
self.imp().command_runner.get().unwrap().clone()
169+
}
170+
167171
pub fn terminal_repository(&self) -> TerminalRepository {
168172
self.imp().terminal_repository.borrow().clone()
169173
}
@@ -273,16 +277,15 @@ impl RootStore {
273277
.arg(supported_terminal.separator_arg)
274278
.arg(cmd.program.clone())
275279
.args(cmd.args.clone());
276-
spawn_cmd = wrap_flatpak_cmd(spawn_cmd);
277280

278281
debug!(?spawn_cmd, "Spawning terminal command");
279-
let mut async_cmd: async_process::Command = spawn_cmd.into();
280-
let mut child = async_cmd.spawn()?;
282+
let mut child = self.command_runner().spawn(spawn_cmd)?;
283+
281284
let this = self.clone();
282285
glib::MainContext::ref_thread_default().spawn_local(async move {
283286
this.reload_till_up(name, 5);
284287
});
285-
if !child.status().await?.success() {
288+
if !child.wait().await?.success() {
286289
return Err(anyhow::anyhow!("Failed to spawn terminal"));
287290
}
288291
Ok(())

0 commit comments

Comments
 (0)