diff --git a/.changes/shell-execute.md b/.changes/shell-execute.md new file mode 100644 index 00000000..39a862f6 --- /dev/null +++ b/.changes/shell-execute.md @@ -0,0 +1,5 @@ +--- +"shell": "patch" +--- + +Run `Command.execute()` JS api, asynchronously in the Rust side to avoid blocking main thread and causing the webview to freeze. diff --git a/plugins/shell/src/commands.rs b/plugins/shell/src/commands.rs index dce61ec5..b5f1ea5a 100644 --- a/plugins/shell/src/commands.rs +++ b/plugins/shell/src/commands.rs @@ -186,7 +186,7 @@ pub struct ChildProcessReturn { #[allow(clippy::too_many_arguments)] #[tauri::command] -pub fn execute( +pub async fn execute( window: Window, program: String, args: ExecuteArgs,