Skip to content

Commit

Permalink
Properly detach daemon on windows in -d mode
Browse files Browse the repository at this point in the history
  • Loading branch information
MolotovCherry committed Sep 4, 2024
1 parent e34c022 commit b0f3743
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pueue/src/bin/pueued.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,17 @@ fn fork_daemon(opt: &CliArguments) -> Result<()> {
"pueued".to_string()
};

Command::new(current_exe)
let mut command = Command::new(current_exe);

#[cfg(target_os = "windows")]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x08000000;

command.creation_flags(CREATE_NO_WINDOW);
}

command

Check warning on line 138 in pueue/src/bin/pueued.rs

View check run for this annotation

Codecov / codecov/patch

pueue/src/bin/pueued.rs#L128-L138

Added lines #L128 - L138 were not covered by tests
.args(&arguments)
.spawn()
.expect("Failed to fork new process.");
Expand Down

0 comments on commit b0f3743

Please sign in to comment.