fix(menu): support silent warmup and F1 restarts without console popup #406

Merged
Androtim merged 1 commit from upstream-pr/406 into main 2026-12-03 19:02:26 +00:00
Androtim commented 2026-12-03 18:47:52 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T18:47:52Z.


Summary

Removes the jarring visible PowerShell/CMD console popup during first-launch Frame Gen warm-up auto-restart and F1 Save and Restart when launched headless from a GUI launcher.

Changes

  • Parent-managed restart (VICTORY_RESTART_EXIT_CODE): In crates/victory-gpu/src/host/menu.rs, when VICTORY_RESTART_EXIT_CODE is set to a valid non-zero u32 (1..=255) and preload == false, Menu::restart skips spawning PowerShell and exits cleanly via crate::ending::end_process(code, true) so the parent launcher can silently relaunch MiniVI.exe while keeping process tracking intact. (VICTORY_WARMUP_MARK continues to be written before self.restart(false).)
  • Silent headless fallback: When falling back to self-relaunch with no attached console (GetConsoleWindow().is_null()) or VICTORY_NO_CONSOLE=1, CreateProcessW uses CREATE_NO_WINDOW instead of CREATE_NEW_CONSOLE, passes -WindowStyle Hidden to powershell.exe, and omits the interactive Read-Host prompt (which would otherwise hang invisibly). Interactive console launches preserve the exact existing CREATE_NEW_CONSOLE + Read-Host behavior.
  • Environment inheritance: Preserves VICTORY_NO_CONSOLE and VICTORY_RESTART_EXIT_CODE in pps/victory/src/play.rs KEPT so child restarts inherit them cleanly.
  • Unit tests: Added tests covering VICTORY_RESTART_EXIT_CODE parsing, console vs. headless command-line generation, and KEPT env var preservation.

Verification

  • cargo test -p victory-gpu --lib host::menu (8 passed)
  • cargo test -p victory (48 unit + 2 integration passed)
  • cargo clippy --workspace --all-targets -- -D warnings (clean)
  • cargo xtask policy (sset policy: 353 files ok)
<!-- greyfinch-sync:Androtim/MiniVI:issue:5632840191 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/406). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-03T18:47:52Z. --- ## Summary Removes the jarring visible PowerShell/CMD console popup during first-launch Frame Gen warm-up auto-restart and F1 **Save and Restart** when launched headless from a GUI launcher. ## Changes - **Parent-managed restart (VICTORY_RESTART_EXIT_CODE)**: In crates/victory-gpu/src/host/menu.rs, when VICTORY_RESTART_EXIT_CODE is set to a valid non-zero u32 (1..=255) and preload == false, Menu::restart skips spawning PowerShell and exits cleanly via crate::ending::end_process(code, true) so the parent launcher can silently relaunch MiniVI.exe while keeping process tracking intact. (VICTORY_WARMUP_MARK continues to be written before self.restart(false).) - **Silent headless fallback**: When falling back to self-relaunch with no attached console (GetConsoleWindow().is_null()) or VICTORY_NO_CONSOLE=1, CreateProcessW uses CREATE_NO_WINDOW instead of CREATE_NEW_CONSOLE, passes -WindowStyle Hidden to powershell.exe, and omits the interactive Read-Host prompt (which would otherwise hang invisibly). Interactive console launches preserve the exact existing CREATE_NEW_CONSOLE + Read-Host behavior. - **Environment inheritance**: Preserves VICTORY_NO_CONSOLE and VICTORY_RESTART_EXIT_CODE in pps/victory/src/play.rs KEPT so child restarts inherit them cleanly. - **Unit tests**: Added tests covering VICTORY_RESTART_EXIT_CODE parsing, console vs. headless command-line generation, and KEPT env var preservation. ## Verification - cargo test -p victory-gpu --lib host::menu (8 passed) - cargo test -p victory (48 unit + 2 integration passed) - cargo clippy --workspace --all-targets -- -D warnings (clean) - cargo xtask policy (sset policy: 353 files ok)
Androtim commented 2026-12-03 19:02:22 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T19:02:22Z.


Audited full diff (4275dfff, CI check PASS, 100% title-neutral): clean launcher/menu restart UX fix (play.rs, Cargo.toml, host/menu.rs) — auto-detects headless mode (GetConsoleWindow().is_null()) with CREATE_NO_WINDOW / -WindowStyle Hidden and supports parent-managed VICTORY_RESTART_EXIT_CODE (1..=255). Zero GPU/shader/perf surface touched; full unit tests pass. Merging via squash.

<!-- greyfinch-sync:Androtim/MiniVI:comment:7389060907 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/406#issuecomment-7389060907). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-03T19:02:22Z. --- Audited full diff (`4275dfff`, **CI `check` PASS**, `100%` title-neutral): clean launcher/menu restart UX fix (`play.rs`, `Cargo.toml`, `host/menu.rs`) — auto-detects headless mode (`GetConsoleWindow().is_null()`) with `CREATE_NO_WINDOW` / `-WindowStyle Hidden` and supports parent-managed `VICTORY_RESTART_EXIT_CODE` (`1..=255`). Zero GPU/shader/perf surface touched; full unit tests pass. Merging via squash.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Androtim/MiniVI!406
No description provided.