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
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:
xdg-open, which either fails or opens a Linux browser inside WSL instead of the Windows defaultThis 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 runinside WSL detects the environment, skipsxdg-open, and prints the URL for the Windows browserwt.exeandpowershell.exeas launch targetsImplementation notes
/proc/versioncontainingmicrosoftorWSLwt.exe -w 0 new-tab(reuses current wt window) andpowershell.exe Start-Processwith title taggingSystem.Windows.Automation) enumerates allTabItemelements, OSC 2 escape injected into target/dev/pts/Xas a short-lived marker, matched via UIA, then restoredMainWindowTitleexact match againstsessionTag, gated onWT_SESSIONenv var to avoid OSC race with conhost title/api/focusvalidatespidas positive integer before/procaccesssessionIdvalidated against^[A-Za-z0-9._-]{1,128}$; launch scripts written tomkdtempwith fixed filenames