Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): keep noisy shell probes from blocking PATH capture #21913

MergedLucenx9(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/21913/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 39 additions and 1 deletion.

x
0 of 2 viewed, 2 left
38 additions and 0 deletionsapps/desktop/src/shell/DesktopShellEnvironment.test.tsModified
View file
@@ -1,6 +1,7 @@
// @effect-diagnostics nodeBuiltinImport:off -- The process fixture runs real shell commands with isolated config files.
import * as NodeServices from "@effect/platform-node/NodeServices";
import { assert, describe, it } from "@effect/vitest";
+import * as HostProcess from "@t3tools/shared/HostProcess";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Logger from "effect/Logger";
@@ -72,6 +73,7 @@
command: ChildProcess.Command,
) => string | { output: string; exitCode: number };
readonly failure?: PlatformError.PlatformError;
+ readonly processSpawner?: ChildProcessSpawner.ChildProcessSpawner["Service"];
}) {
const layerEnvironment = Layer.succeed(
DesktopEnvironment.DesktopEnvironment,
@@ -82,6 +84,7 @@
const layerSpawner = Layer.succeed(
ChildProcessSpawner.ChildProcessSpawner,
ChildProcessSpawner.make((command) => {
+ if (input.processSpawner) return input.processSpawner.spawn(command);
if (input.failure !== undefined) return Effect.fail(input.failure);
const result = input.handler(command);
return Effect.succeed(
@@ -118,6 +121,41 @@
​
describe("DesktopShellEnvironment", () => {