fix(launcher): restore caller environment after play.ps1 #563
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!563
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-563"
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?
@lgtlgt0015-code on GitHub · 2026-11-27 11:37 UTC · original
lgtlgt0015-code:codex/restore-launcher-environment→a-publier· +25 −11 · 1 files · 1 commits · openRunning
play.ps1from an existing PowerShell session changes that session's environment. For example, the launcher replaces an inheritedVICTORY_RELAYwith2and leaves it there after the game exits. It can also remove inherited variables permanently from that shell.Save the original value of each variable the launcher touches and restore it in
finally. The game still gets the launcher presets and-Moreoverrides, while the caller gets its original values back, including whether each variable was set. This does not change the exit-code propagation or messages covered by #459.Verified with a local test executable on PowerShell 7 and Windows PowerShell 5.1. Reproduced the leak on the base branch. Checked that the child receives the expected settings and a path containing spaces, and that the patched launcher restores the caller's settings after both a normal exit and a terminating native-command error. No game files were used.
@AccelArch on GitHub · 2026-11-27 11:56 UTC · original
Read
8765c8bagainst a-publier (4eb6cfd). Tested on Windows PowerShell 5.1.26100 with a stand-in victory.exe (a small program that prints its VICTORY_* environment and returns the exit code from STANDIN_EXIT), running scripts/play.ps1 from a session with VICTORY_RELAY=9, VICTORY_FOO=x and VICTORY_CONFIG=cfg.toml:Not tested: PowerShell 7 and Ctrl-C during a run.
AI-assisted.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.