generated from nhcarrigan/template
fix: suppress terminal window flash on Windows for all subprocesses (#165)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
use std::process::Command;
|
||||
use tauri::command;
|
||||
|
||||
use crate::process_ext::HideWindow;
|
||||
|
||||
#[command]
|
||||
pub async fn send_wsl_notification(title: String, body: String) -> Result<(), String> {
|
||||
// Method 1: Try Windows 10/11 toast notification using PowerShell
|
||||
@@ -36,6 +38,7 @@ $notifier.Show($toast)
|
||||
|
||||
// Try PowerShell.exe through WSL
|
||||
let output = Command::new("/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe")
|
||||
.hide_window()
|
||||
.arg("-NoProfile")
|
||||
.arg("-ExecutionPolicy")
|
||||
.arg("Bypass")
|
||||
@@ -65,6 +68,7 @@ $notifier.Show($toast)
|
||||
|
||||
// Method 3: Try wsl-notify-send if available
|
||||
let notify_result = Command::new("wsl-notify-send")
|
||||
.hide_window()
|
||||
.arg("--appId")
|
||||
.arg("HikariDesktop")
|
||||
.arg("--category")
|
||||
|
||||
Reference in New Issue
Block a user