Port the dev-server pane to the platform launch dialect (Windows) - #1389
Merged
Conversation
The Dev Server button refused on Windows before it read anything: the POSIX guard sat at the top of runDevServer, but what needs tmux is the nested dev-server session and its viewer pane, not the pane concept. Move the guard down to that branch, and author the wrapper it runs in the launch dialect instead of hand-written bash launched through /bin/bash. Auxiliary-pane markers lose their file extension: the dialect names a generated script .ps1 on Windows, so a marker ending in .sh made the pane invisible to every later lookup - which also repairs the column-agent pane there. Fixes #1387
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.
The Dev Server button and
dev3 dev-server startwere dead on Windows:runDevServercalledassertPosixLaunchDialect("the dev-server pane")as its first statement, so the native path never ran. Arseny reproduced it on his own box — issue #1387.Two things were wrong, and fixing either alone is a trap:
dev3-dev-<id>session plus the viewer pane that attaches to it — not the pane concept. The guard moved down to that branch (a Windows task is alwaysnative, so it is unreachable there).#!/bin/bash,set -x,[ $EXIT_CODE -ne 0 ],read -n 1 -s) launched through a hardcoded/bin/bash. Porting only the launch would have been worse than the outage — PowerShell half-runs bash text and looks like it started.The body now lives in
src/bun/dev-server-script.ts, authored in the launch dialect (traceOn/traceOffadded forset -x/Set-PSDebug), and the pane launches it throughgeneratedScriptLaunch/generatedScriptName.Third defect, found on the way, in already-merged code:
AUX_PANE_PURPOSESmarkers carried file extensions (dev.sh,col-agent.sh). The dialect names a generated script.ps1on Windows, so a pane launched there was invisible to every later lookup — is it running, replace it, stop it. Extensions dropped; this also repairs the column-agent pane on Windows.POSIX moved by exactly three lines, deliberately, pinned in their new form: the two
echos became oneprintf, andread -n 1 -sbecame the dialect's shell-portable read (identical under bash, which launches the file).platform-launch-posix-golden.test.tsis untouched and green — no other wrapper moved.What this does NOT fix, and cannot: a project's
devScriptis the user's own text in the user's own shell.bun run devis valid in both dialects;VITE_PORT=\${DEV3_PORT0:-5173} bun run devis a PowerShell parse error. What changes is that the failure is now the user's script failing in a live pane instead of dev3 refusing to open one. Documenting that caveat next todevScriptis a separate, open product question.Proof
Windows workflow run on this branch before merge: 31887058798 —
package-runtime (windows-latest)green, both new steps green. From its log on the real runner:Mutation branch
mutation/dev3-dev-server-bash-hardcoderestores the/bin/bashhardcode to confirm the Windows step goes red for it.Fixes #1387
🔗 Origin task in dev3: open in dev3 ·
dev3://task/723a9754-9241-4fab-a26b-6dd87f347f98