Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(tailscale): Tailscale HTTPS is detected when T3 Code is launched from the macOS Dock #30756

Openbinjamshid(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/30756/headopened View on GitHub

Showing 2 changed files with 49 additions and 11 deletions.

x
0 of 2 viewed, 2 left
33 additions and 0 deletionspackages/tailscale/src/tailscale.test.tsModified
View file
@@ -408,6 +408,39 @@
});
});
​
+ // regression: #15919 - spawned from a Dock-launched app (no SHLVL or TERM), the
+ // macOS app binary runs as the GUI: it prints an error on stdout and exits 0.
+ it.effect("runs the macOS app binary as the CLI", () => {
+ const spawned: Array<{ env: unknown; extendEnv: unknown }> = [];
+ const layer = Layer.merge(
+ Layer.succeed(
+ ChildProcessSpawner.ChildProcessSpawner,
+ ChildProcessSpawner.make((command) => {
+ const { env, extendEnv } = command._tag === "StandardCommand" ? command.options : {};
+ spawned.push({ env, extendEnv });
+ return Effect.succeed(
+ mockHandle({
+ stdout:
+ env?.TAILSCALE_BE_CLI === undefined
+ ? "The Tailscale GUI failed to start: (Tailscale.CLIError error 3.)"
+ : tailscaleStatusJson,
+ }),
+ );
+ }),
+ ),
+ Layer.succeed(HostProcess.Platform, "darwin"),
+ );
+​
+ return Effect.gen(function* () {
+ const status = yield* readTailscaleStatus.pipe(Effect.provide(layer));
+ assert.equal(status.magicDnsName, "desktop.tail.ts.net");