🐛 fix(vscode): 会话终端直接拉起 claude/codex,不再往 shell 里打命令,启动命令不再污染 zsh 历史

新建工单、实施、审查、测试、原型、续聊、冲突解决、会话管理和各种恢复会话,
都改成开终端时直接指定要跑的程序(用户默认 shell 以 -ilc 'exec "$@"' 拉起),
环境变量照常加载,参数原样传入。程序退出时标签页随之关闭。
提示词和配置文件路径里带单引号也不再拒绝执行,相关的转义和拦截全部删掉。
This commit is contained in:
chehongweo committed 2026-09-29 04:40:35 +08:00
1 parent 21000d48e9
commit 3621729367
16 files changed
+232 -330

No files matched your search

+3 -7
View File
@@ -8,8 +8,9 @@
import type { CherryPickConflict } from '../../git/release'
import type { KanbanWebviewPanel } from '../KanbanPanel'
import { window, workspace } from 'vscode'
import { buildCcCommand } from '../../cc/ccCommand'
import { buildCcArgv } from '../../cc/ccCommand'
import { resolveProfilePath } from '../../cc/profiles'
import { sessionLaunch } from '../../cc/sessionTerminal'
import { gitFetch } from '../../git/branches'
import {
attachPulls,
@@ -226,18 +227,13 @@ ${remaining}
return
}
const profilePath = resolveProfilePath(getSettings(panel.context).conflictResolutionProfilePath.trim() || undefined)
if (profilePath.includes('\'')) {
toast(panel, 'error', `冲突解决失败:profilePath 含单引号 (${profilePath})`, { dismissOnTimer: 10_000 })
return
}
const terminal = window.createTerminal({
name: terminalName,
cwd: conflict.worktreePath,
location: panel.resolveTerminalLocation(false),
...sessionLaunch(buildCcArgv({ profilePath, effort: 'high', prompt })),
})
terminal.show(false)
// buildCcCommand 用单引号包提示词,内部的 ' 要转成 '\'' 才不会破壳。
terminal.sendText(buildCcCommand({ profilePath, effort: 'high', prompt: prompt.replace(/'/g, '\'\\\'\'') }))
logger.add({
level: 'info',
source: 'panel',