rust-lang / rust-lang/rust

Tracking Issue for Windows' `CommandExt::inherit_handles`

Open
#146,407 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-tracking-issue O-windows S-tracking-needs-to-bake T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Feature gate: #![feature(windows_process_extensions_inherit_handles)]

This is a tracking issue for a new inherit_handles builder method of the Windows-specific CommandExt extension trait.

In short, it will add the ability to configure the bInheritHandles parameter of the CreateProcessW function used in order to perform the process spawns under Windows. Indeed, it is currently always set to TRUE while all the other parameters already are customizable at least in part. However, under certain circumstances such as when spawning a process with a pseudoconsole attached or when spawning non-PPL processes from a PPL one, either the intended behavior will not work or simply the function call will directly fail. The proposed API will therefore enable one to use the standard process::Command and its Windows extension trait in a fashion compatible with these use cases.

Public API
// std::os::windows::process

pub trait CommandExt: Sealed {
    fn inherit_handles(&mut self, inherit_handles: bool) -> &mut process::Command;
}
Steps / History

(Remember to update the S-tracking-* label when checking boxes.)

  • ACP: rust-lang/libs-team#264
  • Implementation: #115501
  • Final comment period (FCP)^1
  • Stabilization PR
Unresolved Questions
  • None yet.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The implementation is marked complete in #115501; start by reviewing that PR and the Windows process entry point in library/std/src/sys/process/windows.rs, along with the std::os::windows::process::CommandExt API. Check the feature lifecycle guidance for the remaining FCP and stabilization steps. Done means the final comment period and stabilization PR are completed.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.