From 3d5b0cb41bca5622c863755c630cdaec02fbbebd Mon Sep 17 00:00:00 2001 From: Sarah Fortune Date: Mon, 11 May 2026 16:01:00 -0700 Subject: [PATCH] fix(cli/completion): re-apply shell-profile source-line guard (re-#78659) (#80797) --- src/cli/completion-runtime.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cli/completion-runtime.ts b/src/cli/completion-runtime.ts index 408eaffa478..b360b2d7659 100644 --- a/src/cli/completion-runtime.ts +++ b/src/cli/completion-runtime.ts @@ -69,9 +69,9 @@ function formatCompletionSourceLine( cachePath: string, ): string { if (shell === "fish") { - return `source "${cachePath}"`; + return `test -f "${cachePath}"; and source "${cachePath}"`; } - return `source "${cachePath}"`; + return `[ -f "${cachePath}" ] && source "${cachePath}"`; } function isCompletionProfileHeader(line: string): boolean {