Skip to content

Commit df692d7

Browse files
committed
Add "Open in Integrated Terminal" command to workspace context menu
1 parent f22165e commit df692d7

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

‎packages/vscode/package.json‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,12 @@
307307
"command": "codeWebChat.setRange",
308308
"title": "Set Range",
309309
"category": "Code Web Chat"
310+
},
311+
{
312+
"command": "codeWebChat.openInIntegratedTerminal",
313+
"title": "Open in Integrated Terminal",
314+
"category": "Code Web Chat",
315+
"icon": "$(terminal)"
310316
}
311317
],
312318
"menus": {
@@ -538,6 +544,11 @@
538544
"when": "view == codeWebChatViewOpenEditors && viewItem == openEditor",
539545
"group": "1_modification@6"
540546
},
547+
{
548+
"command": "codeWebChat.openInIntegratedTerminal",
549+
"when": "view == codeWebChatViewWorkspace && (viewItem == workspaceRoot || viewItem == directory)",
550+
"group": "1_modification@7"
551+
},
541552
{
542553
"command": "codeWebChat.newFile",
543554
"when": "view == codeWebChatViewWorkspace && viewItem == directory",

‎packages/vscode/src/extension.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,17 @@ export async function activate(context: vscode.ExtensionContext) {
165165
})
166166
}
167167
}
168+
),
169+
vscode.commands.registerCommand(
170+
'codeWebChat.openInIntegratedTerminal',
171+
async (item: any) => {
172+
if (item && item.resourceUri) {
173+
const terminal = vscode.window.createTerminal({
174+
cwd: item.resourceUri.fsPath
175+
})
176+
terminal.show()
177+
}
178+
}
168179
)
169180
)
170181
}

0 commit comments

Comments
 (0)