Skip to content

Skip SetConsoleCP when stdout is non-interactive#701

Open
roman-bcny wants to merge 1 commit intowixtoolset:mainfrom
roman-bcny:fix-console-pipe-failure
Open

Skip SetConsoleCP when stdout is non-interactive#701
roman-bcny wants to merge 1 commit intowixtoolset:mainfrom
roman-bcny:fix-console-pipe-failure

Conversation

@roman-bcny
Copy link
Copy Markdown

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
Copy link
Copy Markdown

github-actions bot commented Mar 25, 2026

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

@roman-bcny
Copy link
Copy Markdown
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
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.

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

1 participant