Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): apps opened from T3 Code no longer inherit ELECTRON_RUN_AS_NODE #20206

MergedJord-JD(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/20206/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 55 additions and 1 deletion.

x
0 of 2 viewed, 2 left
46 additions and 0 deletionsapps/server/src/process/externalLauncher.test.tsModified
View file
@@ -122,6 +122,52 @@
});
​
+it.effect.skipIf(windowsHost)(
+ "launched browsers and editors do not inherit ELECTRON_RUN_AS_NODE",
+ () =>
+ Effect.gen(function* () {
+ const fileSystem = yield* FileSystem.FileSystem;
+ const path = yield* Path.Path;
+ const binDir = yield* fileSystem.makeTempDirectoryScoped({ prefix: "t3-editors-" });
+ const codePath = path.join(binDir, "code");
+ yield* fileSystem.writeFileString(codePath, "#!/bin/sh\n");
+ yield* fileSystem.chmod(codePath, 0o755);
+​
+ const spawned: ChildProcess.StandardCommand[] = [];
+ yield* Effect.gen(function* () {
+ const launcher = yield* ExternalLauncher.ExternalLauncher;
+ yield* launcher.launchBrowser("https://example.com");
+ yield* launcher.launchEditor({ editor: "vscode", cwd: "/workspace" });
+ }).pipe(
+ Effect.provide(
+ layerTest({
+ platform: "linux",
+ env: { PATH: binDir, DISPLAY: ":0" },
+ onSpawn: (command) => spawned.push(command),
+ }),
+ ),
+ Effect.provideService(HostProcess.Environment, {
+ PATH: binDir,