fix: v2.5.7 — panes work on psmux, the Windows tmux

psmux (the WinGet `tmux` on Windows) has no `=name` exact-match targets: it
answered "no server running on session '=agenthub-lane-1'" for a live pane,
so every Windows start reported "the session's command exited as soon as it
started" while the session ran on, and the browser could not attach.

- server/lib/tmux.js: `session`/`pane` targets probe the first live session
  once — `=name` failing where the bare name answers means bare names from
  then on; real tmux keeps `=name` / `=name:` (it matches by prefix otherwise)
- pty-attach.js and cc-update-all-helper.js use the same targets
This commit is contained in:
2026-10-06 23:56:12 +07:00
parent fcf8d8010a
commit 4163f431bb
9 changed files with 88 additions and 13 deletions
+7 -3
View File
@@ -29,6 +29,8 @@ const path = require("path");
const { execFileSync, spawnSync } = require("child_process");
// What a failed command printed — plugin-bootstrap.js says why on STDOUT.
const { failureText } = require("./plugin-update-helper");
// psmux (the Windows `tmux`) has no `=name:` targets; tmux.js knows which form.
const { pane: paneTarget } = require("../server/lib/tmux");
const [, , runtimeDirArg, planJson] = process.argv;
@@ -170,7 +172,7 @@ function reloadPanes() {
try {
paneCmd = execFileSync(
"tmux",
["display-message", "-p", "-t", `=${name}:`, "#{pane_current_command}"],
["display-message", "-p", "-t", paneTarget(name), "#{pane_current_command}"],
{ encoding: "utf8", timeout: 15_000, stdio: ["ignore", "pipe", "pipe"] }
).trim();
} catch {
@@ -190,8 +192,10 @@ function reloadPanes() {
// Atomics.wait, not `sleep`: Windows has no sleep binary.
if (!first) Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 1000);
first = false;
execFileSync("tmux", ["send-keys", "-t", `=${name}:`, "-l", command], { timeout: 15_000 });
execFileSync("tmux", ["send-keys", "-t", `=${name}:`, "Enter"], { timeout: 15_000 });
execFileSync("tmux", ["send-keys", "-t", paneTarget(name), "-l", command], {
timeout: 15_000,
});
execFileSync("tmux", ["send-keys", "-t", paneTarget(name), "Enter"], { timeout: 15_000 });
}
reloaded.push(name);
} catch {