Repository navigation
Resolve zmx against the shell's directory so beta18 loop opens, New Tab, and splits attach - #667
Merged
Merged
Conversation
…s folder #663 started each zmx attach in the loop's worktree or project folder. The installed shell names zmx bare (zmx.exe) and found it only through its own working directory (the install bin), and a child resolves a relative program against its own working directory and then PATH. On a Dev Box whose PATH does not name the install, every sidebar loop open, New Tab, and split failed with FileNotFound (Unable to open selected loop / Unable to create tab). Resolve the configured zmx name against the shell's directory once before the attach spawns, and make the live App terminal fixture use the installed bare-name layout so the gap that hid this is covered. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Colin Neilens <coneilen@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On the installed
0.1.78-windows.beta18shell, every sidebar loop open, native New Tab, and Split Right failed (Unable to open selected loop,Unable to create tab, empty pane, nozmx attachchild). #663 began starting eachzmx attachin the loop's worktree or project folder, but the installed shell names zmx bare (zmx.exe, noGRAPHCODE_ZMX) and found it only through its own working directory, the installbin. Windows child creation resolves a relative program against the child's working directory and then PATH, and on the Dev Box the shell's inherited PATH does not name the install, so every attach failed withFileNotFound. This PR resolves zmx against the shell's directory before spawning.Changes
TerminalSurface.zig:zmxExecutable()resolves a relative configured zmx name (by defaultzmx.exe) to an absolute path against the shell's working directory, once, before the attach spawns in the loop's folder. An absoluteGRAPHCODE_ZMXis used unchanged; a name the shell's directory does not hold is still left to PATH. The listing and resize children already started in the shell's directory, so for them the resolved path changes nothing.App.ziglive terminal fixture: zmx is now the bare namezmx.cmdin the fixture'sbin(the shell's working directory) instead of an absolute path. All four native-linked live tests now cover the installed layout.TerminalSurface.zigunit test for the resolution rules.investigation/ui-parity-matrix.md: the Tab pills row records the beta18 finding and the fix. It staysPartial.Root cause, as reproduced: the shell's PEB showed cwd
...\GraphCode\current\bin, and its PATH (inherited from the harnesspwsh) did not contain that directory. With a diagnostic build launched under the same PATH, both actions logged a spawn failureFileNotFoundwithzmx=zmx.exe dir=(loop folder) cwd=.. With the install on PATH, the same build opened the loop. Winghostty surface creation and the #663 visibility and focus changes were not involved.Why CI missed it: every live fixture and gate passes an absolute zmx path. The App fixture used
root\zmx.cmd, anduia-live-gate.ps1,terminal-gate.ps1, andwindows-shell.ps1setGRAPHCODE_ZMXto the provider's absolutezmx.exe. So the attach child's working directory never affected program lookup. The App fixture now uses the installed bare-name layout. The PowerShell live gates still setGRAPHCODE_ZMX; running the packaged shell without it, from itsbinwith a PATH that omits the install, is left as a follow-up for the gates.Test plan
All runs used the pinned Zig 0.15.2 and Winghostty
6286560d, with-target x86_64-windows-msvcand the full App link line fromTools\windows\Tests\WindowsShell.Tests.ps1, run fromgraphcode-windows.RED: zig test src\App.zig (App link line) --test-filter "workspace surface:" -> 1 passed; 4 failed: all four live loop tests TestTimedOut with status "Unable to open selected loop" (fixture using the installed bare zmx name, before the fix)
GREEN: zig test src\App.zig (App link line) --test-filter "workspace surface:" -> All 5 tests passed
REGRESSION: zig test src\App.zig (full App link line, no filter) -> All 901 tests passed; zig test src\TerminalSurface.zig -target x86_64-windows-msvc -lc -luser32 -lgdi32 -ladvapi32 -> All 166 tests passed
Limits:
startSessionspawn, and I reproduced it with a diagnostic build (FileNotFoundon New Tab), but not in this PR's test before the fix.zig fmt --checkreports these two files onmainas well; that is pre-existing, and this PR does not change it.Checklist
git commit -s) per the DCOmake test) (macOS target; not run, since this is a Windows shell change, and the Windows tests above were run instead)make check) (macOS Swift lint; not applicable, no Swift changed)