Skip to content

Port the dev-server pane to the platform launch dialect (Windows) - #1389

Merged
h0x91b merged 1 commit into
mainfrom
fix/dev3-windows-dev-server-pane
Aug 15, 2026
Merged

Port the dev-server pane to the platform launch dialect (Windows)#1389
h0x91b merged 1 commit into
mainfrom
fix/dev3-windows-dev-server-pane

Conversation

@h0x91b

@h0x91b h0x91b commented Aug 15, 2026

Copy link
Copy Markdown
Owner

The Dev Server button and dev3 dev-server start were dead on Windows: runDevServer called assertPosixLaunchDialect("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:

  1. The guard was in the wrong place. What needs tmux is the nested 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 always native, so it is unreachable there).
  2. The wrapper was hand-written bash (#!/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/traceOff added for set -x / Set-PSDebug), and the pane launches it through generatedScriptLaunch/generatedScriptName.

Third defect, found on the way, in already-merged code: AUX_PANE_PURPOSES markers carried file extensions (dev.sh, col-agent.sh). The dialect names a generated script .ps1 on 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 one printf, and read -n 1 -s became the dialect's shell-portable read (identical under bash, which launches the file). platform-launch-posix-golden.test.ts is untouched and green — no other wrapper moved.

What this does NOT fix, and cannot: a project's devScript is the user's own text in the user's own shell. bun run dev is valid in both dialects; VITE_PORT=\${DEV3_PORT0:-5173} bun run dev is 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 to devScript is a separate, open product question.

Proof

Windows workflow run on this branch before merge: 31887058798package-runtime (windows-latest) green, both new steps green. From its log on the real runner:

← runDevServer done (native pane)          # the refusal is gone on the native path
error: the nested dev-server tmux session requires the tmux backend  # and still fires where it belongs
ok - the dev command actually executed (it wrote its record)
ok - the task env block reached the command (DEV3_TASK_SEQ=1546)
ok - the pane shows the real exit code                # crash reported, no hang on the keypress prompt
ok - the pane launches ...powershell.exe for ...-dev.ps1

Mutation branch mutation/dev3-dev-server-bash-hardcode restores the /bin/bash hardcode 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

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
@h0x91b
h0x91b merged commit 59b80e9 into main Aug 15, 2026
17 checks passed
@h0x91b
h0x91b deleted the fix/dev3-windows-dev-server-pane branch August 15, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows/native backend: dev-server start fails (tmux-only) and pane run times out

1 participant