Skip to content

Commit e4fb4c9

Browse files
author
q1600822305
committed
refactor: remove terminal enhancements (keep core Shell Integration fix)
Reverted: - 77051f2: docs for terminal sync - 3a27736: terminal sync (RooPseudoterminal, openInVscodeTerminal) - 4e54bf9: 100ms debounce removal Kept: - c328295: core fix (race condition, warning toggle, UTF-8) - 7d381b5: save terminalShellIntegrationWarningDisabled setting
1 parent 1f75014 commit e4fb4c9

12 files changed

Lines changed: 17 additions & 544 deletions

File tree

UPDATE_GUIDE.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -118,23 +118,10 @@ pnpm vsix
118118

119119
### 终端增强
120120
- `src/integrations/terminal/TerminalRegistry.ts` - 修复竞态条件
121-
- `src/integrations/terminal/Terminal.ts` - Windows UTF-8 编码支持 + 终端面板显示方法
121+
- `src/integrations/terminal/Terminal.ts` - Windows UTF-8 编码支持
122122
- `src/integrations/terminal/ExecaTerminalProcess.ts` - 内联终端 UTF-8 编码
123-
- `src/integrations/terminal/RooPseudoterminal.ts` - Pseudoterminal 实现(双向同步)
124123
- `src/core/tools/ExecuteCommandTool.ts` - 警告开关逻辑
125-
- `src/core/webview/webviewMessageHandler.ts` - 终端同步按钮处理
126124
- `webview-ui/src/components/settings/TerminalSettings.tsx` - 警告开关 UI
127-
- `webview-ui/src/components/chat/CommandExecution.tsx` - 终端同步按钮 UI
128-
129-
### 终端同步功能(类似 Windsurf/Cursor)
130-
- `packages/types/src/vscode-extension-host.ts` - 添加 `openInVscodeTerminal` 消息类型
131-
- `webview-ui/src/i18n/locales/en/chat.json` - 英文翻译
132-
- `webview-ui/src/i18n/locales/zh-CN/chat.json` - 中文翻译
133-
134-
**功能说明**:点击命令执行区域的终端图标,可以:
135-
1. 切换到 VSCode 终端模式(关闭内联终端)
136-
2. 显示/聚焦 VSCode 终端面板
137-
3. 后续命令在 VSCode 终端执行,输出实时同步到 webview
138125

139126
### Shell Integration 修复
140127
- `src/integrations/terminal/TerminalProcess.ts` - 修复中止按钮 + 30秒超时机制

packages/types/src/vscode-extension-host.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ export interface ExtensionMessage {
107107
| "worktreeDefaults"
108108
| "worktreeIncludeStatus"
109109
| "branchWorktreeIncludeResult"
110-
| "openInVscodeTerminal"
111110
text?: string
112111
payload?: any // eslint-disable-line @typescript-eslint/no-explicit-any
113112
checkpointWarning?: {
@@ -603,7 +602,6 @@ export interface WebviewMessage {
603602
| "checkBranchWorktreeInclude"
604603
| "createWorktreeInclude"
605604
| "checkoutBranch"
606-
| "openInVscodeTerminal"
607605
text?: string
608606
editedMessageContent?: string
609607
tab?: "settings" | "history" | "mcp" | "modes" | "chat" | "marketplace" | "cloud"
@@ -642,8 +640,6 @@ export interface WebviewMessage {
642640
ids?: string[]
643641
hasSystemPromptOverride?: boolean
644642
terminalOperation?: "continue" | "abort"
645-
commandToOpenInTerminal?: string
646-
outputToOpenInTerminal?: string
647643
messageTs?: number
648644
restoreCheckpoint?: boolean
649645
historyPreviewCollapsed?: boolean

src/core/tools/ExecuteCommandTool.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,6 @@ export async function executeCommandInTerminal(
201201
let shellIntegrationError: string | undefined
202202
let hasAskedForCommandOutput = false
203203

204-
// Use VSCode terminal when shell integration is enabled, otherwise use execa
205-
// When using VSCode terminal, output syncs to both webview and terminal panel in real-time
206204
const terminalProvider = terminalShellIntegrationDisabled ? "execa" : "vscode"
207205
const provider = await task.providerRef.deref()
208206

src/core/webview/webviewMessageHandler.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import { MessageEnhancer } from "./messageEnhancer"
4040
import { checkExistKey } from "../../shared/checkExistApiConfig"
4141
import { experimentDefault } from "../../shared/experiments"
4242
import { Terminal } from "../../integrations/terminal/Terminal"
43-
import { TerminalRegistry } from "../../integrations/terminal/TerminalRegistry"
4443
import { openFile } from "../../integrations/misc/open-file"
4544
import { openImage, saveImage } from "../../integrations/misc/image-handler"
4645
import { selectImages } from "../../integrations/misc/process-images"
@@ -671,29 +670,6 @@ export const webviewMessageHandler = async (
671670
provider.getCurrentTask()?.handleTerminalOperation(message.terminalOperation)
672671
}
673672
break
674-
case "openInVscodeTerminal":
675-
// Switch to VSCode terminal mode and show the terminal panel
676-
// This disables inline terminal and enables real-time sync
677-
{
678-
// Disable inline terminal mode
679-
await provider.contextProxy.setValue("terminalShellIntegrationDisabled", false)
680-
Terminal.setShellIntegrationDisabled(false)
681-
682-
const cwd = provider.getCurrentTask()?.cwd || vscode.workspace.workspaceFolders?.[0]?.uri.fsPath
683-
const taskId = provider.getCurrentTask()?.taskId
684-
685-
if (cwd) {
686-
// Get or create a VSCode terminal and show it
687-
const terminal = await TerminalRegistry.getOrCreateTerminal(cwd, taskId, "vscode")
688-
if (terminal instanceof Terminal) {
689-
terminal.showTerminal(false) // false = focus on terminal
690-
}
691-
}
692-
693-
// Update webview state
694-
await provider.postStateToWebview()
695-
}
696-
break
697673
case "clearTask":
698674
// Clear task resets the current session. Delegation flows are
699675
// handled via metadata; parent resumption occurs through

0 commit comments

Comments
 (0)