diff options
| author | Frank <[email protected]> | 2025-07-27 14:57:45 -0400 |
|---|---|---|
| committer | Frank <[email protected]> | 2025-07-27 14:57:45 -0400 |
| commit | 3eb982c8cd5a593f1649d49bd90eab4ae7fecd3f (patch) | |
| tree | ef44613f6016eb3b695dca6b54abd8e4eb71c134 /sdks/vscode/src/extension.ts | |
| parent | 45c4e0b8f8caaeab39e44f90c59697e083443450 (diff) | |
| download | opencode-3eb982c8cd5a593f1649d49bd90eab4ae7fecd3f.tar.gz opencode-3eb982c8cd5a593f1649d49bd90eab4ae7fecd3f.zip | |
vscode: bring oc terminal to front if already opened
Diffstat (limited to 'sdks/vscode/src/extension.ts')
| -rw-r--r-- | sdks/vscode/src/extension.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sdks/vscode/src/extension.ts b/sdks/vscode/src/extension.ts index 49a05f641..fa6e5c55f 100644 --- a/sdks/vscode/src/extension.ts +++ b/sdks/vscode/src/extension.ts @@ -8,6 +8,13 @@ export function activate(context: vscode.ExtensionContext) { // Register command to open terminal in split screen and run opencode let openTerminalDisposable = vscode.commands.registerCommand("opencode.openTerminal", async () => { + // An opencode terminal already exists => focus it + const existingTerminal = vscode.window.terminals.find((t) => t.name === TERMINAL_NAME) + if (existingTerminal) { + existingTerminal.show() + return + } + // Create a new terminal in split screen const port = Math.floor(Math.random() * (65535 - 16384 + 1)) + 16384 const terminal = vscode.window.createTerminal({ |
