The best way to control Claude Code, Codex and more from any computer or phone
fix(scripts): dev runner expands ~ in --home-dir and T3CODE_HOME (#25560)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net>
MarcoDotIO committed
Oct 29, 2026 at 13:46 UTC
20490521fa4adc3b16a652bc3592405d0ec4a790
2 files changed
+37
scripts/dev-runner.test.ts
+31
@@ -412,6 +412,37 @@ it.layer(NodeServices.layer)("dev-runner", (it) => {
412
}),
413
);
414
415
+ it.effect("expands a home-relative T3 home the way the server does", () =>
416
+ Effect.gen(function* () {
417
+ const path = yield* Path.Path;
418
+ const homeFor = (t3Home: string) =>
419
+ createDevRunnerEnv({
420
+ mode: "dev",
421
+ baseEnv: {},
422
+ serverOffset: 0,
423
+ webOffset: 0,
424
+ t3Home,
425
+ browser: undefined,
426
+ autoBootstrapProjectFromCwd: undefined,
427
+ logWebSocketEvents: undefined,
428
+ host: undefined,
429
+ port: undefined,
430
+ devUrl: undefined,
431
+ }).pipe(
432
+ Effect.provideService(HostProcess.HomeDirectory, "/home/dev"),
433
+ Effect.map((env) => env.T3CODE_HOME),
434
+ );
435
+
436
+ assert.equal(yield* homeFor("~/t3-dev"), path.join("/home/dev", "t3-dev"));
437
+ assert.equal(yield* homeFor("~"), "/home/dev");
438
+ assert.equal(yield* homeFor("~\\t3-dev"), path.join("/home/dev", "t3-dev"));
439
+ assert.equal(yield* homeFor(" ~/t3-dev "), path.join("/home/dev", "t3-dev"));
440
+ assert.equal(yield* homeFor("~someone/t3-dev"), path.resolve("~someone/t3-dev"));
441
+ assert.equal(yield* homeFor("relative/t3-dev"), path.resolve("relative/t3-dev"));
442
+ assert.equal(yield* homeFor("/tmp/t3-dev"), path.resolve("/tmp/t3-dev"));
443
+ }),
444
+ );
445
+
446
it.effect("rejects a specific non-loopback --host for browser dev modes", () => {
447
const spawnerLayer = Layer.succeed(
448
ChildProcessSpawner.ChildProcessSpawner,
scripts/dev-runner.ts
+6
@@ -272,6 +272,12 @@ const resolveBaseDir = Effect.fn("dev-runner.resolveBaseDir")(function* (
272
const path = yield* Path.Path;
273
const configured = baseDir?.trim();
274
275
+ if (configured === "~") {
276
+ return yield* HostProcess.HomeDirectory;
277
+ }
278
+ if (configured?.startsWith("~/") || configured?.startsWith("~\\")) {
279
+ return path.join(yield* HostProcess.HomeDirectory, configured.slice(2));
280
+ }
281
if (configured) {
282
return path.resolve(configured);
283
}