//go:build windows package api import ( "os/exec" ) // startTermSession (windows) tries the kernel32 ConPTY API first. ConPTY // gives a real pseudo terminal, so wsl.exe / pwsh / cmd render their // prompt and the user can interact normally. If ConPTY is unavailable // (Windows < 10 1809) or the call fails for any reason, we fall back to // the line-buffered pipe session — degraded but functional for non-TUI // commands. func startTermSession(cmd *exec.Cmd) (termSession, error) { if sess, err := startConptySession(cmd); err == nil { return sess, nil } return startPipeSession(cmd) }