Fix desktop CLI passthrough tty handling (#791)

* Fix desktop CLI passthrough tty handling

* Fix desktop daemon manager test drift

* Update daemon stop test after main merge

* test(cli): isolate npx cache per CLI test
This commit is contained in:
Mohamed Boudra
2026-05-07 15:14:18 +08:00
committed by GitHub
parent 6fb2fe2283
commit faf664d803
20 changed files with 868 additions and 461 deletions
@@ -1,6 +1,3 @@
const IGNORED_ARG_PREFIXES = ["-psn_", "--no-sandbox"];
export const DESKTOP_CLI_ENV = "PASEO_DESKTOP_CLI";
const PASEO_NODE_ENV = "PASEO_NODE_ENV";
export interface NodeEntrypointSpec {
@@ -26,12 +23,6 @@ interface CreateNodeEntrypointInvocationInput {
baseEnv: NodeJS.ProcessEnv;
}
interface ParseCliPassthroughArgsFromArgvInput {
argv: string[];
isDefaultApp: boolean;
forceCli: boolean;
}
export function createElectronNodeEnv(
baseEnv: NodeJS.ProcessEnv,
options?: { isPackaged?: boolean },
@@ -43,26 +34,6 @@ export function createElectronNodeEnv(
};
}
export function parseCliPassthroughArgsFromArgv(
input: ParseCliPassthroughArgsFromArgvInput,
): string[] | null {
const startIndex = input.isDefaultApp ? 2 : 1;
const effective: string[] = [];
for (const arg of input.argv.slice(startIndex)) {
if (IGNORED_ARG_PREFIXES.some((prefix) => arg.startsWith(prefix))) {
continue;
}
effective.push(arg);
}
if (input.forceCli) {
return effective;
}
return effective.length > 0 ? effective : null;
}
export function createNodeEntrypointInvocation(
input: CreateNodeEntrypointInvocationInput,
): NodeEntrypointInvocation {