#11 Enable Windows

Opened by Lale on Nov 18, 2026, 3:34 PM
Approve the patches, then land them on main with:
// Lale on Nov 18, 2026, 3:34 PM

(AI generated)

What I Found (empirical)

TestResult
Session via extension (relay + node-pty)TUSTEP starts, then Error in TXTWIN from function sb: Das handle ist ungültig
tustep.exe with piped stdinPopup: „kein Konsolenfenster gefunden“ — TUSTEP demands a real console
Start via winptywinpty assertion in winpty.cc:924 (no size without a tty)
-s in a real console window (Start-Process)Window opens, process dies instantly, popup
Installer shortcut / .tsd file associationtustep.exe /e / tustep.exe /s "%1" — slash switches

Three concrete bugs to fix

  1. Wrong switch syntax on Windows (relay.ts): extension passes -s; Windows TUSTEP expects /s (proven by the installer’s own registry entry). Make it platform-dependent.

  2. TSD file line endings (session.ts): written with LF (join('\n')); write CRLF on Windows. Also: the generated file has TUSTEP_PRJ= empty even though the default is 'vscode' — normalize the project value before validating and writing.

  3. No working directory for TUSTEP (relay.ts, spawn(...)): add cwd: dirname(startProgram) so tustep.ini is found.

Remaining open question

Whether TUSTEP’s TXTWIN works under ConPTY at all (your “handle ist ungültig” suggests it might not). First test the fixes above in a plain cmd window:

cd "C:\Program Files (x86)\tustep"
tustep.exe /s D:\Daten_LG\Documents\tustep-vscode\.tustep-vscode\tustep.txt

If the dialog runs there but not in VS Code, the fallback is spawning TUSTEP in a real console via conhost.exe instead of the relay.

Sideshow

npm scripts are POSIX-only (rm -rf, GNU find/chmod in postinstall) — they break Windows builds/packaging. Irrelevant to the runtime bug, but worth fixing for Windows development.

// Lale 4 hours ago

(AI generated)

Update: sources checked

The manuals and the C sources shipped with the installation (tustep/source-code/win/) settle most open questions.

Confirmed by source:

  • -s is invalid — parser only accepts /s, /e, /d, /.tsd, /.tf (start.c:451ff). Bug #1 confirmed.
  • “kein Konsolenfenster gefunden” = AllocConsole() + SetConsoleActiveScreenBuffer failing on piped stdout (start.c:165–171).
  • The VS Code relay error is exactly SetConsoleActiveScreenBuffer on a non-console stdout: ERROR_INVALID_HANDLE (txtwin.c:113), reached only in dialog mode — which start.c:539 always forces (TUSTEP_MDS=DIALOG, the preceding GetEnvironmentVariable is commented out).
  • But: TSD lines become env vars after that (start.c:585ff), so TUSTEP_MDS=BATCH in the TSD would skip TXTWIN entirely — an option for one-shot task runs, not for the interactive relay.
  • TSD parser strips CR and LF (start.c:610ff) → CRLF fix is defensive only.
  • start.c checks the DelegationConsole registry key (default terminal must be conhost) on every start.

Still to check (needs Windows):

  1. Decisive: tustep.exe /s <generated .tsd> in a plain cmd window — does the dialog run there?
  2. Same via the fixed extension — does TXTWIN work under ConPTY? (Expected: no.)
  3. One-shot run with TUSTEP_MDS=BATCH added to the TSD.

Plan: fix the three bugs + tests (npm test gate) → retest on Windows → if ConPTY still fails, spawn via conhost.exe in the relay → cross-platform npm scripts → document in docs/tustep-session-integration.md, verify a packaged .vsix.