launcher: clear standard handles before FreeConsole #2

Closed
github-bot wants to merge 1 commit from gh-pr/2/head into gh-pr/2/base
Owner

@⁠MoltenHydrogen on GitHub · 2026-11-29 19:05 UTC · original
MoltenHydrogen:main → main · +9 −3 · 1 files · 1 commits · closed without merging

Problem

When victory.exe is launched without arguments, window::run detaches from its console via FreeConsole() without clearing the process's standard I/O handles (STD_INPUT_HANDLE, STD_OUTPUT_HANDLE, STD_ERROR_HANDLE).

Clicking Translate, Warm used, or Warm all spawns a child victory.exe process with CREATE_NEW_CONSOLE and default (Stdio::inherit) handles. On Windows 11 / Windows Terminal (ConPTY), CreateProcess fails to duplicate the parent's freed console handles and returns os error 50 (ERROR_NOT_SUPPORTED):

Translating shaders could not be started. The request is not supported (os error 50)

Fix

Call SetStdHandle with null_mut() for STD_INPUT_HANDLE, STD_OUTPUT_HANDLE, and STD_ERROR_HANDLE immediately before FreeConsole() in apps/victory/src/launcher/window.rs.

With null standard handles and CREATE_NEW_CONSOLE, Windows automatically attaches the new console window's standard handles to the spawned child process so progress output remains visible in the spawned window.

Testing

  • Built victory in --release mode on Windows 11.
  • Launched victory.exe directly without arguments and clicked Translate, Warm used, and Warm all; each opens its separate console window and runs without os error 50.

Code and description were written by Gemini Neon and Hydrogen, respectively.

**@⁠MoltenHydrogen** on GitHub · 2026-11-29 19:05 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/2) `MoltenHydrogen:main` → `main` · +9 −3 · 1 files · 1 commits · closed without merging ## Problem When `victory.exe` is launched without arguments, `window::run` detaches from its console via `FreeConsole()` without clearing the process's standard I/O handles (`STD_INPUT_HANDLE`, `STD_OUTPUT_HANDLE`, `STD_ERROR_HANDLE`). Clicking **Translate**, **Warm used**, or **Warm all** spawns a child `victory.exe` process with `CREATE_NEW_CONSOLE` and default (`Stdio::inherit`) handles. On Windows 11 / Windows Terminal (ConPTY), `CreateProcess` fails to duplicate the parent's freed console handles and returns `os error 50` (`ERROR_NOT_SUPPORTED`): > Translating shaders could not be started. The request is not supported (os error 50) ## Fix Call `SetStdHandle` with `null_mut()` for `STD_INPUT_HANDLE`, `STD_OUTPUT_HANDLE`, and `STD_ERROR_HANDLE` immediately before `FreeConsole()` in `apps/victory/src/launcher/window.rs`. With null standard handles and `CREATE_NEW_CONSOLE`, Windows automatically attaches the new console window's standard handles to the spawned child process so progress output remains visible in the spawned window. ## Testing - Built `victory` in `--release` mode on Windows 11. - Launched `victory.exe` directly without arguments and clicked **Translate**, **Warm used**, and **Warm all**; each opens its separate console window and runs without `os error 50`. Code and description were written by Gemini Neon and Hydrogen, respectively.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 14:09:09 +00:00
github-bot closed this pull request 2026-11-30 14:09:09 +00:00
Author
Owner

@⁠ReTerryDavis on GitHub · 2026-11-29 19:42 UTC · original

thank you but i just fixed this in 9a70c8c

**@⁠ReTerryDavis** on GitHub · 2026-11-29 19:42 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/2#issuecomment-7261493744) thank you but i just fixed this in 9a70c8c

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.