Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Process Creation Flags. #52

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

videobitva
Copy link

@videobitva videobitva commented Nov 25, 2020

Adds the ability to set the process creation flags for Windows process via param in the PopenConfig struct.
This is a workaround for #40, so you can, for example, pass flag 0x08000000, which hides the CMD on Windows, or any other flag you want.

@KapJI
Copy link

KapJI commented Jul 6, 2022

@hniksic can you please take a look? Not having this makes use cases of subprocess on Windows quite limited.

@@ -110,6 +110,8 @@ pub struct PopenConfig {
pub stderr: Redirection,
/// Whether the `Popen` instance is initially detached.
pub detached: bool,
/// Process Creation Flags
pub creation_flags: u32,
Copy link

Choose a reason for hiding this comment

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

I think this should be behind #[cfg(windows)].

@gameraccoon
Copy link

gameraccoon commented May 15, 2023

Do I understand correctly, there is no way to suppress showing console window of a child process for a non-console application on Windows without merging this in?

@videobitva
Copy link
Author

Do I understand correctly, there is no way to suppress showing console window of a child process for a non-console application on Windows without merging this in?

Hi!

As far as I know -- yes.

When I was making this pull request I was just getting into Rust, thus I've tried finding and using libraries like this one (having familiar interface was very important for me). As of now, I do recommend using either standard Command or async one from tokio. This library probably won't break you free from building some interface on top of it (for example, task, thread, channel, etc), so the amount of code you write won't change that much by using std or tokio (as this library mimics python library interface, making it not that far from standard Command interface).

If you really do need this library, you can just use my fork, I've made it up to date with master (or apply the changes you need by yourself).

Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants