Files
hyperframes/packages/cli/src/utils/windowsProcesses.ts
T
Miguel Ángel b930c4d2d7 fix(cli): Windows Chrome cleanup and process reads no longer pass PowerShell command text (#8085)
* fix(cli): Windows process reads and Chrome cleanup no longer pass PowerShell command text

* fix(cli): a forced Chrome close on Windows ends what Chrome started

* test(cli): the forced-close test's child holds no pipe to the browser

* test(cli): the forced-close test's child outlives a dead parent, as Chrome's do

* test(cli): forced-close test waits for the kill; PowerShell starts only via processReadArgs

* fix(cli): Windows cleanup ends only a process the CLI started, never a pid it was handed
2026-11-17 20:27:58 +00:00

18 lines
543 B
TypeScript

import { fileURLToPath } from "node:url";
type ProcessRead = "identity" | "parent" | "table" | "version";
/** One read of processes.ps1, shipped beside this code; antivirus flags PowerShell given command text. */
export function processReadArgs(read: ProcessRead, target?: string | number): string[] {
return [
"-NoProfile",
"-NonInteractive",
"-ExecutionPolicy",
"Bypass",
"-File",
fileURLToPath(new URL("./processes.ps1", import.meta.url)),
read,
...(target === undefined ? [] : [String(target)]),
];
}