🐛 fix(vscode): GUI 下解析 claude 绝对路径(含 ~/.local/bin 官方安装)

This commit is contained in:
2026-08-05 14:57:48 +08:00
parent 81ab00bdba
commit 9255b55625
4 changed files with 127 additions and 14 deletions
+7 -1
View File
@@ -1,3 +1,5 @@
import { resolveClaudeBin } from './claudeBin'
/**
* Single source of truth for the `claude` (cc) terminal launch command.
*
@@ -20,8 +22,12 @@ export interface CcCommandOpts {
prompt?: string
}
function quoteIfNeeded(bin: string): string {
return bin.includes(' ') ? `'${bin}'` : bin
}
export function buildCcCommand(opts: CcCommandOpts): string {
const parts = ['claude']
const parts = [quoteIfNeeded(resolveClaudeBin() ?? 'claude')]
if (opts.effort)
parts.push(`--effort ${opts.effort}`)
parts.push('--dangerously-skip-permissions', `--settings '${opts.profilePath}'`)