fix(menu,victory): prevent headless restart stdin deadlocks and clear stale restart exit code #407
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/407"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T19:20:51Z.
Follow-up to #406 addressing both the
[P0]and[P1]issues identified in the Gate 2 audit:Summary
[P0]Prevent invisible stdin deadlocks on headlessCREATE_NO_WINDOWrestarts:interactive_console()(backed by pure testableis_interactive_console+GetConsoleWindow()on Windows) inapps/victory/src/play.rsand replaced all rawstd::io::stdin().is_terminal()prompt gates (offer_dlss,offer_fsr,offer_mfg,check_shader_model,hold_window). Interactive prompts are now skipped whenVICTORY_NO_CONSOLE=1, whenGetConsoleWindow()is null (such as aCREATE_NO_WINDOWwindowless console whoseCONIN$still reportsis_terminal() == true), or when stdin is not a terminal.restart_command_lineincrates/victory-gpu/src/host/menu.rsto pass-NonInteractivetopowershell.exeand pipe$null | & '{play}' {args}so child processes receive closed/EOF stdin instead ofCONIN$.[P1]Clear staleVICTORY_RESTART_EXIT_CODEacross self-spawned PowerShell restarts:Remove-Item Env:VICTORY_RESTART_EXIT_CODE -ErrorAction SilentlyContinue;in both console and headless branches ofrestart_command_lineso that after apreload == trueself-restart (where the original parent launcher saw exit code0and stopped supervising), subsequent restarts in the child session self-relaunch instead of exiting with the stale code into an unsupervised PowerShell host.Verification
cargo test -p victory-gpu --lib host::menu— 8 passedcargo test -p victory— 49 unit + 2 integration passedcargo clippy --workspace --all-targets -- -D warnings— cleancargo xtask policy—asset policy: 354 files okImported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T19:32:36Z.
Read-only full diff audit (
4cd20c2d,apps/victory/src/play.rs+crates/victory-gpu/src/host/menu.rs, 100% title-neutral): VERIFIED CLEAN (0 P0/P1). Properly closes both#406Gate 2 findings (interactive_console()viaGetConsoleWindow()+VICTORY_NO_CONSOLE=1,-NonInteractive+$null | &stdin EOF, and clearingVICTORY_RESTART_EXIT_CODEon self-spawned PowerShell restarts) with zero GPU/shader surface touched. Queued for immediate squash-merge as soon as CIcheckcompletes green.