Skip to content

Commit 868a72f

Browse files
authored
fix(spawn): force tty allocation (-tt) for interactive SSH session (#23)
* fix(spawn): run agent directly via ssh instead of attaching tmux * fix(spawn): force tty allocation (-tt) for interactive opencode session via SSH * chore: bump version for ssh tty fix
1 parent 771bd64 commit 868a72f

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

.changeset/fix-tty.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@spawn-dock/cli": patch
3+
---
4+
5+
fix: force TTY allocation (-tt) during SSH so opencode is fully interactive without tmux

packages/app/src/docker-git/spawn.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,18 @@ const spawnAttachDirect = (
132132
{
133133
cwd: process.cwd(),
134134
command: "ssh",
135-
args: buildSshArgs(
136-
template,
137-
sshKey,
138-
ipAddress,
139-
`cd '${projectDir}' && spawn-dock agent`
140-
).filter((arg) =>
141-
arg !== "-T" && arg !== "-o" && arg !== "BatchMode=yes" && arg !== "ConnectTimeout=2" &&
142-
arg !== "ConnectionAttempts=1"
143-
)
135+
args: [
136+
"-tt", // Force TTY allocation for interactive opencode session
137+
...buildSshArgs(
138+
template,
139+
sshKey,
140+
ipAddress,
141+
`cd '${projectDir}' && spawn-dock agent`
142+
).filter((arg) =>
143+
arg !== "-T" && arg !== "-o" && arg !== "BatchMode=yes" && arg !== "ConnectTimeout=2" &&
144+
arg !== "ConnectionAttempts=1"
145+
)
146+
]
144147
},
145148
[0, 255], // SSH frequently exits with 255 on user disconnect, which is normal
146149
(exitCode) => new CommandFailedError({ command: "ssh agent", exitCode })

0 commit comments

Comments
 (0)