  // regression: #26577 a timed-out git that outlives its timeout holds a process permit
  it.effect.skipIf(HostProcess.Platform.defaultValue() === "win32")(
    "kills a timed-out git command that ignores SIGTERM",
    () =>
      Effect.gen(function* () {
        const cwd = yield* makeTmpDir();
        yield* initRepoWithCommit(cwd);
        const pathService = yield* Path.Path;
        const fileSystem = yield* FileSystem.FileSystem;
        const markerPath = pathService.join(yield* makeTmpDir(), "outlived-timeout");
        const driver = yield* GitVcsDriver.GitVcsDriver;
        const trapped = yield* Deferred.make<void>();

        const command = yield* driver
          .execute({
            operation: "GitVcsDriver.test.ignoresSigterm",
            cwd,
            args: [
              "-c",
              `alias.hang=!trap '' TERM; echo trapped; sleep 3; touch '${markerPath}'`,
              "hang",
            ],
            progress: {
              onStdoutLine: (line) =>
                line === "trapped" ? Deferred.succeed(trapped, undefined) : Effect.void,
            },
          })
          .pipe(Effect.forkChild);
        yield* Deferred.await(trapped);
        // The driver's timeout ends a command the same way: by interrupting it.
        yield* Fiber.interrupt(command);

        assert.isFalse(
          yield* fileSystem.exists(markerPath),
          "the timed-out git command kept running until it finished on its own",
        );
      }),
  );

