Skip to content

Commit

Permalink
Show message when extension disabled in gitpod flex environment
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanp413 committed Sep 25, 2024
1 parent 79e4915 commit 018581c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Gitpod",
"description": "Gitpod Support",
"publisher": "gitpod",
"version": "0.0.174",
"version": "0.0.175",
"license": "MIT",
"icon": "resources/gitpod.png",
"repository": {
Expand Down
15 changes: 15 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ export async function activate(context: vscode.ExtensionContext) {

if (isGitpodFlexRemoteWindow()) {
vscode.commands.executeCommand('setContext', 'gitpod.inGitpodFlexRemoteWindow', true);
context.subscriptions.push(vscode.window.registerUriHandler({
handleUri(uri: vscode.Uri) {
try {
const params: SSHConnectionParams = JSON.parse(uri.query);
const openNewWindow = 'Use New Window';
vscode.window.showInformationMessage(`We cannot open Gitpod workspace on ${params.gitpodHost} from a Gitpod Flex environment window.`, openNewWindow)
.then(action => {
if (action === openNewWindow) {
vscode.commands.executeCommand('vscode.newWindow', { remoteAuthority: null });
}
});
} catch {
}
}
}));
return;
}

Expand Down

0 comments on commit 018581c

Please sign in to comment.