Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,11 @@ async fn run_peekaboo_cli_command(
#[cfg(unix)]
command.process_group(0);

// Suppress the console window the bundled Peekaboo CLI would otherwise
// flash on Windows (it is spawned without a parent console).
#[cfg(windows)]
command.creation_flags(app_platform::CREATE_NO_WINDOW);

let child = command
.spawn()
.map_err(|err| format!("Failed to run bundled Peekaboo CLI: {}", err))?;
Expand Down
8 changes: 5 additions & 3 deletions src-tauri/crates/app-paths/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -876,9 +876,11 @@ pub fn set_sensitive_file_permissions(path: &Path) -> std::io::Result<()> {

#[cfg(windows)]
fn current_windows_account_for_acl() -> Option<String> {
let whoami = std::process::Command::new("whoami")
.stdin(Stdio::null())
.stderr(Stdio::null())
let mut cmd = std::process::Command::new("whoami");
cmd.stdin(Stdio::null()).stderr(Stdio::null());
// Suppress console window on Windows.
app_platform::hide_console(&mut cmd);
let whoami = cmd
.output()
.ok()
.and_then(|output| {
Expand Down
17 changes: 10 additions & 7 deletions src-tauri/src/benchmark/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,16 @@ pub(super) async fn terminate_process(process_id: u32) -> Result<(), String> {
.await;

#[cfg(windows)]
let output = Command::new("taskkill")
.arg("/PID")
.arg(process_id.to_string())
.arg("/T")
.arg("/F")
.output()
.await;
let output = {
let mut cmd = Command::new("taskkill");
cmd.arg("/PID")
.arg(process_id.to_string())
.arg("/T")
.arg("/F");
// Suppress the console window on Windows.
cmd.creation_flags(app_platform::CREATE_NO_WINDOW);
cmd.output().await
};

let output =
output.map_err(|error| format!("Failed to terminate process {process_id}: {error}"))?;
Expand Down
Loading