fix(terminal/windows): fallback to pipes when PTY unsupported (v0.7.1)
All checks were successful
PR Check / check (pull_request) Successful in 57s

The terminal tab was unusable on Windows: creack/pty has no native
Windows ConPTY support, so pty.Start() returned "operating system not
supported" and the WebSocket closed immediately on any tab click —
even though the menu detection (wsl --list --quiet, pwsh, cmd) worked.

Introduce a termSession interface with two implementations selected at
runtime:
- ptySession (unix): unchanged behaviour, real PTY via creack/pty,
  resize works, vim/top behave normally.
- pipeSession (windows): plain stdin + merged stdout/stderr pipes,
  forwarded to the WebSocket. Resize is a no-op (no SIGWINCH without a
  TTY), so full-screen TUIs misbehave in this mode — but launching
  wsl.exe, pwsh, or cmd works for line-based interaction, which is
  what the menu shortcuts target.

handleTerminalWS now goes through startTermSession(cmd); the unix path
is unchanged, the windows fallback kicks in only when pty.Start would
have failed.

Bump v0.7.0 → v0.7.1; CHANGELOG entry added.
This commit is contained in:
Muyue
2026-04-27 11:56:40 +02:00
parent 654444ccc8
commit fc7a5b9d87
4 changed files with 224 additions and 21 deletions

View File

@@ -7,7 +7,7 @@ import (
const (
Name = "muyue"
Version = "0.7.0"
Version = "0.7.1"
Author = "La Légion de Muyue"
)