Skip to content

Allow Server Command menu to open a URL in an external browser #755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
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
13 changes: 11 additions & 2 deletions src/commands/studio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,17 @@ class StudioActions {
`;
});
});
case 3: // Run an EXE on the client.
throw new Error("processUserAction: Run EXE (Action=5) not supported");
case 3: {
// Run an EXE on the client.
const urlRegex = /^(ht|f)tp(s?):\/\//gim;
if (target.search(urlRegex) === 0) {
// Allow target that is a URL to be opened in an external browser
vscode.env.openExternal(vscode.Uri.parse(target));
break;
} else {
throw new Error("processUserAction: Run EXE (Action=3) not supported");
}
}
case 4: {
// Insert the text in Target in the current document at the current selection point
const editor = vscode.window.activeTextEditor;
Expand Down