The best way to control Claude Code, Codex and more from any computer or phone
fix(ssh): ignore alias commands and TTY requests for T3 connections (#24570)
Julius Marminge committed
Nov 13, 2026 at 23:55 UTC
1ed6e325595669b97943a7556d5a19e90ac1c5c7
2 files changed
+30
-1
packages/ssh/src/command.test.ts
+24
-1
@@ -12,7 +12,7 @@ import * as Stream from "effect/Stream";
12
import * as TestClock from "effect/testing/TestClock";
13
import { ChildProcess, ChildProcessSpawner } from "effect/process";
14
15
-import { parseSshResolveOutput, remoteStateKey, runSshCommand } from "./command.ts";
15
+import { baseSshArgs, parseSshResolveOutput, remoteStateKey, runSshCommand } from "./command.ts";
16
import { SshCommandError } from "./errors.ts";
17
18
const encoder = new TextEncoder();
@@ -77,6 +77,29 @@ describe("ssh command", () => {
77
);
78
});
79
80
+ it.effect("overrides an alias's RemoteCommand and RequestTTY", () =>
81
+ Effect.sync(() => {
82
+ assert.deepEqual(
83
+ baseSshArgs(
84
+ { alias: "devbox", hostname: "devbox", username: null, port: 2222 },
85
+ { batchMode: "yes" },
86
+ ),
87
+ [
88
+ "-o",
89
+ "BatchMode=yes",
90
+ "-o",
91
+ "ConnectTimeout=10",
92
+ "-o",
93
+ "RemoteCommand=none",
94
+ "-o",
95
+ "RequestTTY=no",
96
+ "-p",
97
+ "2222",
98
+ ],
99
+ );
100
+ }),
101
+ );
102
+
103
// Remote servers store state under this key, so it must not change across releases.
104
it.effect("derives a stable remote state key", () =>
105
Effect.gen(function* () {
packages/ssh/src/command.ts
+6
@@ -113,6 +113,12 @@ export function baseSshArgs(
113
`BatchMode=${input?.batchMode ?? "no"}`,
114
"-o",
115
"ConnectTimeout=10",
116
+ // T3 always supplies its own remote command or only forwards ports, so a host
117
+ // alias's RemoteCommand or RequestTTY must not hijack the session.
118
+ "-o",
119
+ "RemoteCommand=none",
120
+ "-o",
121
+ "RequestTTY=no",
122
...(target.port !== null ? ["-p", String(target.port)] : []),
123
];
124
}