oconnor663 / duct.rs

a Rust library for running child processes
MIT License
795 stars 34 forks source link

Support for process creation flags on Windows #86

Closed Boscop closed 4 years ago

Boscop commented 4 years ago

Would it be possible to add support for process creation flags on Windows, like this?

(In my current use case I'd like to pass the flag CREATE_NEW_PROCESS_GROUP so that my child processes don't get killed by Ctrl-C, because I use the ctrlc crate to catch the signal and want to do graceful termination, and that requires that the child processes aren't forcefully killed. Which currently happens because by default they are in the same process group as the parent.)

oconnor663 commented 4 years ago

Could you handle this case with the before_spawn method? It's intended as kind of a catch-all for these sorts of low-level operations.

Boscop commented 4 years ago

@oconnor663 Works perfectly, thanks :)