|
|
|
@ -13,7 +13,7 @@ use tauri::{
|
|
|
|
|
|
|
|
|
|
use crate::{
|
|
|
|
|
open::Program,
|
|
|
|
|
process::{CommandEvent, TerminatedPayload},
|
|
|
|
|
process::{CommandEvent, ExitStatus, TerminatedPayload},
|
|
|
|
|
scope::ExecuteArgs,
|
|
|
|
|
Shell,
|
|
|
|
|
};
|
|
|
|
@ -302,6 +302,19 @@ pub fn kill<R: Runtime>(
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[tauri::command]
|
|
|
|
|
pub async fn wait<R: Runtime>(
|
|
|
|
|
_window: Window<R>,
|
|
|
|
|
shell: State<'_, Shell<R>>,
|
|
|
|
|
pid: ChildId,
|
|
|
|
|
) -> crate::Result<ExitStatus> {
|
|
|
|
|
if let Some(child) = shell.children.lock().unwrap().get(&pid) {
|
|
|
|
|
child.wait().await
|
|
|
|
|
} else {
|
|
|
|
|
Err(crate::Error::UnknowChildProcess)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[tauri::command]
|
|
|
|
|
pub async fn open<R: Runtime>(
|
|
|
|
|
_window: Window<R>,
|
|
|
|
|