Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
7e0a4dd
Revert "Try to prevent additional cases in which terminal commands lo…
Mar 8, 2025
384b469
Revert "Handle outputless commands"
Mar 8, 2025
75de043
Revert "Remove terminal actions"
Mar 8, 2025
13c75a1
Revert "Disable terminal actions for now"
Mar 8, 2025
070a36b
Revert "Smart truncation for terminal output"
Mar 8, 2025
60c14d8
test: add comprehensive terminal command execution testing
Mar 4, 2025
3a950bb
refactor: Rename TerminalInfo to Terminal and relocate to Terminal.ts
Mar 4, 2025
daf36f3
refactor: move interpretExitCode from TerminalManager to TerminalProcess
Mar 4, 2025
e24e5b2
refactor: move getTerminalContents to Terminal class
Mar 4, 2025
0e41241
fix: replace echo -e with printf in terminal tests
Mar 4, 2025
304fcf2
fix: improve terminal execution with shell integration status
Mar 5, 2025
59745a7
refactor: establish natural terminal hierarchy
Mar 6, 2025
2412986
test: properly handle exit codes in terminal tests
Mar 6, 2025
3157bf2
refactor: move interpretExitCode from TerminalManager to TerminalProcess
Mar 6, 2025
1973f87
fix: prevent duplicate terminal handler registration
Mar 6, 2025
bf2ce7e
refactor: move terminal functionality to Terminal class
Mar 6, 2025
bc8cfc9
fix: prevent terminal sharing between Roo tasks
Mar 6, 2025
9f5a67e
refactor: remove TerminalManager after migration
Mar 6, 2025
d25bcb1
test: suppress stderr output in TerminalProcessExec tests
Mar 6, 2025
24d8ef9
fix: emit line event when command output starts
Mar 7, 2025
25e46a2
fix: terminal output not showing after command completion
Mar 7, 2025
e27c6aa
fix: terminal process isolation between parallel Cline tasks
Mar 7, 2025
1a1432d
fix: remove forced directory changes that break shell integration
Mar 8, 2025
2319f96
test: update Terminal constructor calls
Mar 8, 2025
5c9f772
docs: document TerminalProcess stability guidelines
Mar 8, 2025
e3b682f
perf: use string instead of array for terminal output
Mar 8, 2025
5de0133
docs: fix test file path in comment
Mar 8, 2025
1601401
cleanup: remove unused stream property from Terminal
Mar 8, 2025
7dadf4c
refactor: remove redundant terminal ID from event handling
Mar 8, 2025
a867595
doc: enhance shell integration error messages
Mar 9, 2025
f2891d7
test: update no_shell_integration event test
Mar 9, 2025
8de202b
fix: prevent UI freeze when terminal stream is unavailable
Mar 9, 2025
4e0f868
fix: improve error handling when start sequence not received but stre…
Mar 9, 2025
8b8c4fd
fix: handle undefined exit codes in terminal output
Mar 9, 2025
c31a5e5
perf: optimize truncateOutput for large inputs
Mar 9, 2025
5be49e1
fix: apply terminal output line limits consistently
Mar 9, 2025
269ddf9
fix: avoid duplicate terminal output accumulation
Mar 10, 2025
131f9ad
feat: add run-length encoding for repeated lines
Mar 10, 2025
0b4fa0b
feat: compress repeated terminal output lines
Mar 10, 2025
e3adee4
fix: allow background terminals to broadcast output across tasks
Mar 10, 2025
62ffa79
fix: prevent spurious onDidEndTerminalShellExecution from breaking te…
Mar 11, 2025
701b5a7
test: align terminal tests with shell integration safeguards
Mar 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,31 @@
"command": "roo-cline.addToContext",
"title": "Roo Code: Add To Context",
"category": "Roo Code"
},
{
"command": "roo-cline.terminalAddToContext",
"title": "Roo Code: Add Terminal Content to Context",
"category": "Terminal"
},
{
"command": "roo-cline.terminalFixCommand",
"title": "Roo Code: Fix This Command",
"category": "Terminal"
},
{
"command": "roo-cline.terminalExplainCommand",
"title": "Roo Code: Explain This Command",
"category": "Terminal"
},
{
"command": "roo-cline.terminalFixCommandInCurrentTask",
"title": "Roo Code: Fix This Command (Current Task)",
"category": "Terminal"
},
{
"command": "roo-cline.terminalExplainCommandInCurrentTask",
"title": "Roo Code: Explain This Command (Current Task)",
"category": "Terminal"
}
],
"menus": {
Expand All @@ -153,6 +178,28 @@
"group": "Roo Code@4"
}
],
"terminal/context": [
{
"command": "roo-cline.terminalAddToContext",
"group": "Roo Code@1"
},
{
"command": "roo-cline.terminalFixCommand",
"group": "Roo Code@2"
},
{
"command": "roo-cline.terminalExplainCommand",
"group": "Roo Code@3"
},
{
"command": "roo-cline.terminalFixCommandInCurrentTask",
"group": "Roo Code@5"
},
{
"command": "roo-cline.terminalExplainCommandInCurrentTask",
"group": "Roo Code@6"
}
],
"view/title": [
{
"command": "roo-cline.plusButtonClicked",
Expand Down
1 change: 1 addition & 0 deletions src/activate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export { handleUri } from "./handleUri"
export { registerCommands } from "./registerCommands"
export { registerCodeActions } from "./registerCodeActions"
export { createRooCodeAPI } from "./createRooCodeAPI"
export { registerTerminalActions } from "./registerTerminalActions"
70 changes: 70 additions & 0 deletions src/activate/registerTerminalActions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import * as vscode from "vscode"
import { ClineProvider } from "../core/webview/ClineProvider"
import { Terminal } from "../integrations/terminal/Terminal"

const TERMINAL_COMMAND_IDS = {
ADD_TO_CONTEXT: "roo-cline.terminalAddToContext",
FIX: "roo-cline.terminalFixCommand",
FIX_IN_CURRENT_TASK: "roo-cline.terminalFixCommandInCurrentTask",
EXPLAIN: "roo-cline.terminalExplainCommand",
EXPLAIN_IN_CURRENT_TASK: "roo-cline.terminalExplainCommandInCurrentTask",
} as const

export const registerTerminalActions = (context: vscode.ExtensionContext) => {
registerTerminalAction(context, TERMINAL_COMMAND_IDS.ADD_TO_CONTEXT, "TERMINAL_ADD_TO_CONTEXT")

registerTerminalActionPair(context, TERMINAL_COMMAND_IDS.FIX, "TERMINAL_FIX", "What would you like Roo to fix?")

registerTerminalActionPair(
context,
TERMINAL_COMMAND_IDS.EXPLAIN,
"TERMINAL_EXPLAIN",
"What would you like Roo to explain?",
)
}

const registerTerminalAction = (
context: vscode.ExtensionContext,
command: string,
promptType: "TERMINAL_ADD_TO_CONTEXT" | "TERMINAL_FIX" | "TERMINAL_EXPLAIN",
inputPrompt?: string,
) => {
context.subscriptions.push(
vscode.commands.registerCommand(command, async (args: any) => {
let content = args.selection
if (!content || content === "") {
content = await Terminal.getTerminalContents(promptType === "TERMINAL_ADD_TO_CONTEXT" ? -1 : 1)
}

if (!content) {
vscode.window.showWarningMessage("No terminal content selected")
return
}

const params: Record<string, any> = {
terminalContent: content,
}

if (inputPrompt) {
params.userInput =
(await vscode.window.showInputBox({
prompt: inputPrompt,
})) ?? ""
}

await ClineProvider.handleTerminalAction(command, promptType, params)
}),
)
}

const registerTerminalActionPair = (
context: vscode.ExtensionContext,
baseCommand: string,
promptType: "TERMINAL_ADD_TO_CONTEXT" | "TERMINAL_FIX" | "TERMINAL_EXPLAIN",
inputPrompt?: string,
) => {
// Register new task version
registerTerminalAction(context, baseCommand, promptType, inputPrompt)
// Register current task version
registerTerminalAction(context, `${baseCommand}InCurrentTask`, promptType, inputPrompt)
}
Loading
Loading