Skip to content
Draft
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
6 changes: 4 additions & 2 deletions crates/command/src/async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,13 @@ impl Command {
#[cfg(all(windows, not(feature = "test-util")))]
{
use async_process::windows::CommandExt;
use windows::Win32::System::Threading;
// We need to set the `CREATE_BREAKAWAY_FROM_JOB` flag to avoid assigning
// the process to the same Job Object as the Warp process, otherwise the
// process will be killed when the Warp process is killed.
let flags = windows::Win32::System::Threading::CREATE_NO_WINDOW.0
| windows::Win32::System::Threading::CREATE_BREAKAWAY_FROM_JOB.0;
let flags = Threading::CREATE_NO_WINDOW.0
| Threading::DETACHED_PROCESS.0
| Threading::CREATE_BREAKAWAY_FROM_JOB.0;
Comment on lines +107 to +109
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 [SUGGESTION] DETACHED_PROCESS causes Windows to ignore CREATE_NO_WINDOW, so keeping both makes the effective console behavior harder to reason about.

Suggested change
let flags = Threading::CREATE_NO_WINDOW.0
| Threading::DETACHED_PROCESS.0
| Threading::CREATE_BREAKAWAY_FROM_JOB.0;
let flags = Threading::DETACHED_PROCESS.0
| Threading::CREATE_BREAKAWAY_FROM_JOB.0;

inner.creation_flags(flags);
}
Self {
Expand Down
Loading