Skip to content

Commit 9adc918

Browse files
committed
Update studio.ts
Allow Server Command Menu to open a URL in an external browser
1 parent 10aa9f8 commit 9adc918

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/commands/studio.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,17 @@ class StudioActions {
162162
`;
163163
});
164164
});
165-
case 3: // Run an EXE on the client.
166-
throw new Error("processUserAction: Run EXE (Action=5) not supported");
165+
case 3: {
166+
// Run an EXE on the client.
167+
const urlRegex = /^(ht|f)tp(s?):\/\//gim;
168+
if (target.search(urlRegex) === 0) {
169+
// Allow target that is a URL to be opened in an external browser
170+
vscode.env.openExternal(vscode.Uri.parse(target));
171+
break;
172+
} else {
173+
throw new Error("processUserAction: Run EXE (Action=3) not supported");
174+
}
175+
}
167176
case 4: {
168177
// Insert the text in Target in the current document at the current selection point
169178
const editor = vscode.window.activeTextEditor;

0 commit comments

Comments
 (0)