Skip to content

feat: run codedash from WSL with Windows-host browser UI (launch, focus, IDE) #173

@vbp1

Description

@vbp1

Problem

When codedash is installed and runs inside WSL, the web UI opens in a Windows browser but terminal-related features don't work across the WSL ↔ Windows boundary:

  • Launch/Resume has no way to open a Windows Terminal tab or PowerShell window from WSL
  • Focus cannot locate or activate the correct terminal window/tab on the Windows host
  • Open in IDE doesn't handle the WSL ↔ Windows path translation or Remote-WSL extensions
  • Browser auto-open tries xdg-open, which either fails or opens a Linux browser inside WSL instead of the Windows default

This is the mirror of #149 (which covers codedash on Windows reading WSL sessions). This issue covers codedash inside WSL managing Windows-host terminals.

Expected behavior

  • codedash run inside WSL detects the environment, skips xdg-open, and prints the URL for the Windows browser
  • The terminal picker offers wt.exe and powershell.exe as launch targets
  • Resume opens a new tab in the current Windows Terminal window (not a separate window per session)
  • Focus reliably selects the correct wt tab even in multi-tab setups, and falls back to MainWindowTitle matching for PowerShell/conhost windows
  • Open in IDE detects VS Code / Cursor Remote-WSL extensions and translates paths correctly

Implementation notes

  • WSL detection via /proc/version containing microsoft or WSL
  • Terminal launch via wt.exe -w 0 new-tab (reuses current wt window) and powershell.exe Start-Process with title tagging
  • Focus for Windows Terminal: UI Automation (System.Windows.Automation) enumerates all TabItem elements, OSC 2 escape injected into target /dev/pts/X as a short-lived marker, matched via UIA, then restored
  • Focus for conhost/PowerShell: MainWindowTitle exact match against sessionTag, gated on WT_SESSION env var to avoid OSC race with conhost title
  • /api/focus validates pid as positive integer before /proc access
  • sessionId validated against ^[A-Za-z0-9._-]{1,128}$; launch scripts written to mkdtemp with fixed filenames

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions