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

spawn_with_attributes for Command on #7238

Open
heaths opened this issue Apr 4, 2025 · 1 comment
Open

spawn_with_attributes for Command on #7238

heaths opened this issue Apr 4, 2025 · 1 comment
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-process Module: tokio/process

Comments

@heaths
Copy link

heaths commented Apr 4, 2025

Is your feature request related to a problem? Please describe.

To have a process write to a pseudoterminal (pty) on Windows, you need to adjust its thread proc attributes. There's currently no way to do this with tokio::process::Command.

Describe the solution you'd like

It would be great if tokio added support on Windows like the nightly CommandExt::spawn_with_attributes. I'd be happy to submit a PR.

Describe alternatives you've considered

I'm using std currently and reading in a spawned task not only is this the only place I'm using std::process::Command instead of tokio's, but without all your async plumbing I'm having trouble waiting for a BufReader to finish after the process terminates. This already works correctly with tokio.

@heaths heaths added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. labels Apr 4, 2025
@mox692 mox692 added the M-process Module: tokio/process label Apr 5, 2025
@Darksonn
Copy link
Contributor

Darksonn commented Apr 7, 2025

There is currently no mechanism to let Tokio to access unstable features in std. Not even --cfg tokio_unstable allows that. We cannot support this at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-process Module: tokio/process
Projects
None yet
Development

No branches or pull requests

3 participants