MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / registerTerminalAction

Function registerTerminalAction

src/activate/registerTerminalActions.ts:16–39  ·  view source on GitHub ↗
(
	context: vscode.ExtensionContext,
	command: TerminalActionId,
	promptType: TerminalActionPromptType,
)

Source from the content-addressed store, hash-verified

14}
15
16const registerTerminalAction = (
17 context: vscode.ExtensionContext,
18 command: TerminalActionId,
19 promptType: TerminalActionPromptType,
20) => {
21 context.subscriptions.push(
22 vscode.commands.registerCommand(getTerminalCommand(command), async (args: any) => {
23 let content = args?.selection
24
25 if (!content || content === "") {
26 content = await Terminal.getTerminalContents(promptType === "TERMINAL_ADD_TO_CONTEXT" ? -1 : 1)
27 }
28
29 if (!content) {
30 vscode.window.showWarningMessage(t("common:warnings.no_terminal_content"))
31 return
32 }
33
34 await ClineProvider.handleTerminalAction(command, promptType, {
35 terminalContent: content,
36 })
37 }),
38 )
39}

Callers 1

registerTerminalActionsFunction · 0.85

Calls 6

getTerminalCommandFunction · 0.90
tFunction · 0.90
registerCommandMethod · 0.80
getTerminalContentsMethod · 0.80
showWarningMessageMethod · 0.80
handleTerminalActionMethod · 0.80

Tested by

no test coverage detected