fix(cli): keep update completion refresh lightweight

This commit is contained in:
Peter Steinberger
2026-04-27 08:23:44 +01:00
parent 1ee893bc5f
commit f427ddc220
7 changed files with 55 additions and 9 deletions

View File

@@ -22,6 +22,7 @@ import { defaultRuntime } from "../../runtime.js";
import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js";
import { theme } from "../../terminal/theme.js";
import { pathExists } from "../../utils.js";
import { COMPLETION_SKIP_PLUGIN_COMMANDS_ENV } from "../completion-runtime.js";
export type UpdateCommandOptions = {
json?: boolean;
@@ -268,7 +269,10 @@ export async function tryWriteCompletionCache(root: string, jsonMode: boolean):
const result = spawnSync(resolveNodeRunner(), [binPath, "completion", "--write-state"], {
cwd: root,
env: process.env,
env: {
...process.env,
[COMPLETION_SKIP_PLUGIN_COMMANDS_ENV]: "1",
},
encoding: "utf-8",
timeout: COMPLETION_CACHE_WRITE_TIMEOUT_MS,
});