fix: v2.5.8 — the browser terminal attaches on Windows
node-pty on Windows looks the file it starts up on PATH exactly as given and
never adds `.exe`, so `tmux attach-session` started as a bare `tmux` failed
with "File not found" on every attach: the browser's terminal socket opened,
closed, and reconnected every 1.5 s.
- pty-attach.js: attachBinary names tmux by its full file name on Windows
(ai-tools.which("tmux"), else tmux.exe)
- websocket.js: an attach that throws is logged as `[WS] attach <run> failed`,
the one place that says why the terminal keeps reconnecting
This commit is contained in:
@@ -121,6 +121,9 @@ function initPtyWebSocket(server) {
|
||||
try {
|
||||
attach(ws, runId, size || { cols: 80, rows: 24 });
|
||||
} catch (err) {
|
||||
// The browser only sees a socket that closed and retries every 1.5 s;
|
||||
// this line is the one place that says why.
|
||||
console.warn(`[WS] attach ${runId} failed:`, err.message);
|
||||
try {
|
||||
ws.close(1008, err.message);
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user