Skip to content

Feature request: hide the Windows console window for ConPTY child processes #937

Description

@JuReyms

Problem

Applications that use node-pty in the background on Windows may briefly show a console window for every spawned ConPTY process. This is disruptive for batch-style CLI invocations where the host application already owns the UI.

Current API

IPtyForkOptions exposes useConpty, but no option analogous to Node's windowsHide.

Requested API

Please consider an explicit, opt-in option such as:

pty.spawn(file, args, {
  useConpty: true,
  windowsHide: true,
});

On Windows, it should prevent a visible console window while preserving the actual pseudo-terminal and its output. Other platforms should retain current behavior.

Why this matters

Switching from a PTY to ordinary pipes is not an acceptable workaround for tools that require a real console: some CLIs can exit successfully yet provide no capturable output when run through pipes.

Acceptance criteria

  • No visible terminal flash when windowsHide is enabled on Windows.
  • ConPTY input/output, resize, exit code, timeout, and cancellation behavior remain intact.
  • Unsupported platforms retain current behavior or ignore the option safely.

Happy to test a Windows implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions