Skip to main content

Mountain/IPC/WindServiceHandlers/NativeHost/
Relaunch.rs

1
2//! `nativeHost:relaunch` - restart the process with the same argv.
3//! VS Code calls this from `ILifecycleMainService.relaunch()` when an
4//! extension update is applied, the user picks "Restart to Apply", or
5//! the workbench triggers a self-restart after a crash.
6
7use serde_json::Value;
8use tauri::AppHandle;
9
10use crate::dev_log;
11
12pub async fn Fn(ApplicationHandle:AppHandle, _Arguments:Vec<Value>) -> Result<Value, String> {
13	dev_log!("lifecycle", "nativeHost:relaunch - restarting process");
14
15	// restart() calls std::process::exit internally - return type is `!`
16	// which coerces to Result<Value, String>, so no Ok() needed.
17	ApplicationHandle.restart()
18}