Skip to content

Windows: editor and WSL browser launches flash a console window (detached spawns are spawned unhidden) #36791

Closed as not planned

Description

@kumar-karan

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Run T3 Code on Windows with VS Code installed, so the editor resolves to %LOCALAPPDATA%\Programs\Microsoft VS Code\bin\code.cmd.
  2. Click a file link in a thread to open it in the editor (or run any "Open in editor" action).
  3. Watch the screen while the launch runs.

Expected behavior

The editor (or browser link) opens without a transient console window.

Actual behavior

A cmd.exe console window flashes on every editor launch; in WSL, every launchBrowser call shows a powershell.exe console on the Windows host for the duration of the launch.

Root cause

apps/server/src/process/externalLauncher.ts spawns external launches detached without windowsHide. Effect's NodeChildProcessSpawner resolves spawn options as windowsHide: options.windowsHide ?? !detached (@effect/platform-node-shared buildSpawnOptions), so every detached launch is spawned unhidden — Node skips CREATE_NO_WINDOW. Two sites are affected:

  • launchEditorProcess uses detached: launch.detached ?? true. VS Code, Cursor and Codex resolve through packages/shared/src/editor.ts to console shims (code.cmd, cursor.cmd, …), and resolveSpawnCommand (packages/shared/src/shell.ts) launches those with shell: true, producing a visible cmd.exe wrapper.
  • WSL browser links go through buildBrowserLaunch → resolveWindowsBrowserLaunch(target, resolveWslPowerShellPath(), true), showing a detached, unhidden powershell.exe console on the Windows host.

The non-detached paths are already hidden by Effect's windowsHide: true default for non-detached children (shipped in @effect/platform-node-shared 4.0.0-beta.107, the fix behind #2537), and #19288 already paired detached: true, windowsHide: true for Git-for-Windows reads. The detached external launches above were missed.

Fix: pass windowsHide: true at the two detached spawn sites. On macOS and Linux libuv ignores windowsHide, so the change only affects Windows.

Activity

  1. juliusmarminge commented on Nov 14, 2026

    @juliusmarminge
    Member

    I tried to reproduce this on the current build and could not.

    Commit 86ec940 (origin/main), on a pooled Windows Server 2025 machine with a logged-in desktop. I ran the server's real ExternalLauncher.layer on NodeServices through a scratch driver, launched hidden onto the interactive desktop with wscript. A second script on the desktop enumerated visible ConsoleWindowClass / CASCADIA_HOSTING_WINDOW_CLASS / PseudoConsoleWindow top-level windows every 50 ms. (1) Editor: real VS Code (official win32-x64 archive) with its bin\code.cmd on PATH; launchEditor({editor:'vscode', cwd:'...\file.ts:3:1'}) spawned cmd.exe /d /s /c "code.CMD" --goto ... detached, and VS Code opened file.ts. No console window appeared in 3 runs (VS Code cold and already running). (2) Positive control: same harness with a fake code.cmd that runs ping -n 8. The monitor caught a new console window ('ping -n 8 127.0.0.1') within about 100 ms, so it does detect such a flash. (3) The proposed fix (windowsHide: true added to launchEditorProcess) with the console-program shim: the console window still appeared, because libuv's CREATE_NO_WINDOW is ignored together with DETACHED_PROCESS, and the window belongs to the shim's console child, not cmd.exe. (4) WSL browser: Node 24 in WSL Ubuntu ran the exact launch shape buildBrowserLaunch produces (powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -EncodedCommand <Start 'https://example.com'>, detached, stdio ignore) with windowsHide false and with it true; this was a reduced script, not the launcher module. Edge opened both times and no console window appeared. On WSL the server is a Linux process, where Node ignores windowsHide.

    Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.

  2. juliusmarminge commented on Nov 14, 2026

    @juliusmarminge
    Member

    A fix for this was proposed in #36794, but when the reported steps were run in the real app the problem did not appear.

    What was run on b05c505b9c, the commit before this change:

    On each commit: open the synthetic Demo project in T3 Code, choose Open in VS Code, and watch the Windows desktop as VS Code opens. Separately, close the browser, start T3 Code from an existing visible WSL terminal with browser auto-open enabled, and watch the Windows desktop until Edge opens the T3 client. Both applications opened on both commits. No additional transient launch console was observed on either commit.

    How: Manual comparison on a real Windows Server 2025 desktop at 1920×1080. Separate checkouts and fresh T3 state with seeding disabled. Playwright drove the real web client against native Windows dev servers; VS Code's real code.cmd launcher was on PATH. WSL Ubuntu 24.04 ran each commit's real server with browser auto-open enabled. Whole-desktop recordings were inspected before upload. WSL videos retain the first 45 seconds, with the browser address-bar band masked for privacy.

    Could you share the exact steps, what you see, and the version and platform you are on? The pull request is closed for now; the fix is picked up again once the problem can be shown.

  3. added
    needs more info
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs more info

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions