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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user