Skip to content

Skip SetConsoleCP when stdout is non-interactive#701

Merged
robmen merged 1 commit into
wixtoolset:mainfrom
roman-bcny:fix-console-pipe-failure
Jun 9, 2026
Merged

Skip SetConsoleCP when stdout is non-interactive#701
robmen merged 1 commit into
wixtoolset:mainfrom
roman-bcny:fix-console-pipe-failure

Conversation

@roman-bcny

Copy link
Copy Markdown
Contributor

When stdout is a pipe (e.g. wixnative.exe spawned by wix.exe), SetConsoleCP/SetConsoleOutputCP may fail if the console subsystem has not been initialized. The failure path in ConsoleInitialize closes the stdin/stdout pipe handles, causing wixnative to exit and wix.exe to get IOException: The pipe is being closed.

This gates the SetConsoleCP calls on vfStdOutInteractive, which is already computed earlier in ConsoleInitialize. Pipe-based I/O does not use the console codepage — both sides handle UTF-8 encoding explicitly.

Fixes wixtoolset/issues#9267

@github-actions

github-actions Bot commented Mar 25, 2026

Copy link
Copy Markdown

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@roman-bcny

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

wixbot added a commit to wixtoolset/.github that referenced this pull request Mar 25, 2026
@robmen robmen enabled auto-merge (rebase) June 9, 2026 19:37
@robmen robmen marked this pull request as draft June 9, 2026 20:17
auto-merge was automatically disabled June 9, 2026 20:17

Pull request was converted to draft

@robmen robmen marked this pull request as ready for review June 9, 2026 20:17
@robmen robmen enabled auto-merge (rebase) June 9, 2026 20:18
@robmen robmen closed this Jun 9, 2026
auto-merge was automatically disabled June 9, 2026 20:21

Pull request was closed

@robmen robmen reopened this Jun 9, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 9, 2026
@robmen robmen enabled auto-merge (rebase) June 9, 2026 20:21
@robmen robmen merged commit 34d99cb into wixtoolset:main Jun 9, 2026
3 of 4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wixnative.exe pipe failure when console is not initialized (SetConsoleCP closes stdin/stdout)

2 participants