diff --git a/.changeset/fix-tty.md b/.changeset/fix-tty.md new file mode 100644 index 0000000..2a77229 --- /dev/null +++ b/.changeset/fix-tty.md @@ -0,0 +1,5 @@ +--- +"@spawn-dock/cli": patch +--- + +fix: force TTY allocation (-tt) during SSH so opencode is fully interactive without tmux diff --git a/packages/app/src/docker-git/spawn.ts b/packages/app/src/docker-git/spawn.ts index 16f5ef4..324389b 100644 --- a/packages/app/src/docker-git/spawn.ts +++ b/packages/app/src/docker-git/spawn.ts @@ -132,15 +132,18 @@ const spawnAttachDirect = ( { cwd: process.cwd(), command: "ssh", - args: buildSshArgs( - template, - sshKey, - ipAddress, - `cd '${projectDir}' && spawn-dock agent` - ).filter((arg) => - arg !== "-T" && arg !== "-o" && arg !== "BatchMode=yes" && arg !== "ConnectTimeout=2" && - arg !== "ConnectionAttempts=1" - ) + args: [ + "-tt", // Force TTY allocation for interactive opencode session + ...buildSshArgs( + template, + sshKey, + ipAddress, + `cd '${projectDir}' && spawn-dock agent` + ).filter((arg) => + arg !== "-T" && arg !== "-o" && arg !== "BatchMode=yes" && arg !== "ConnectTimeout=2" && + arg !== "ConnectionAttempts=1" + ) + ] }, [0, 255], // SSH frequently exits with 255 on user disconnect, which is normal (exitCode) => new CommandFailedError({ command: "ssh agent", exitCode })