Skip to content

Commit 79e4915

Browse files
authored
Fix and rename inGitpodFlexRemoteWindow context key (#110)
* Fix and rename inGitpodFlexRemoteWindow context key * 🆙 bump version
1 parent 4b58838 commit 79e4915

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Gitpod",
44
"description": "Gitpod Support",
55
"publisher": "gitpod",
6-
"version": "0.0.173",
6+
"version": "0.0.174",
77
"license": "MIT",
88
"icon": "resources/gitpod.png",
99
"repository": {
@@ -271,27 +271,27 @@
271271
"commandPalette": [
272272
{
273273
"command": "gitpod.signIn",
274-
"when": "!gitpod.inGpNextRemoteWindow"
274+
"when": "!gitpod.inGitpodFlexRemoteWindow"
275275
},
276276
{
277277
"command": "gitpod.exportLogs",
278-
"when": "!gitpod.inGpNextRemoteWindow"
278+
"when": "!gitpod.inGitpodFlexRemoteWindow"
279279
},
280280
{
281281
"command": "gitpod.workspaces.refresh",
282-
"when": "gitpod.authenticated == true && !gitpod.inGpNextRemoteWindow"
282+
"when": "gitpod.authenticated == true && !gitpod.inGitpodFlexRemoteWindow"
283283
},
284284
{
285285
"command": "gitpod.workspaces.connectInNewWindow",
286-
"when": "gitpod.authenticated == true && !gitpod.inGpNextRemoteWindow"
286+
"when": "gitpod.authenticated == true && !gitpod.inGitpodFlexRemoteWindow"
287287
},
288288
{
289289
"command": "gitpod.workspaces.connectInNewWindow_context",
290290
"when": "false"
291291
},
292292
{
293293
"command": "gitpod.workspaces.connectInCurrentWindow",
294-
"when": "gitpod.authenticated == true && !gitpod.inGpNextRemoteWindow"
294+
"when": "gitpod.authenticated == true && !gitpod.inGitpodFlexRemoteWindow"
295295
},
296296
{
297297
"command": "gitpod.workspaces.connectInCurrentWindow_context",
@@ -311,7 +311,7 @@
311311
},
312312
{
313313
"command": "gitpod.workspaces.stopWorkspace",
314-
"when": "gitpod.authenticated == true && gitpod.inWorkspace != true && !gitpod.inGpNextRemoteWindow"
314+
"when": "gitpod.authenticated == true && gitpod.inWorkspace != true && !gitpod.inGitpodFlexRemoteWindow"
315315
},
316316
{
317317
"command": "gitpod.workspaces.stopWorkspace_context",
@@ -339,7 +339,7 @@
339339
},
340340
{
341341
"command": "gitpod.workspaces.deleteWorkspace",
342-
"when": "gitpod.authenticated == true && gitpod.inWorkspace != true && !gitpod.inGpNextRemoteWindow"
342+
"when": "gitpod.authenticated == true && gitpod.inWorkspace != true && !gitpod.inGitpodFlexRemoteWindow"
343343
},
344344
{
345345
"command": "gitpod.workspaces.deleteWorkspace_context",
@@ -366,13 +366,13 @@
366366
"id": "gitpod-login",
367367
"name": "Login",
368368
"icon": "$(squirrel)",
369-
"when": "gitpod.authenticated != true && !gitpod.inGpNextRemoteWindow"
369+
"when": "gitpod.authenticated != true && !gitpod.inGitpodFlexRemoteWindow"
370370
},
371371
{
372372
"id": "gitpod-workspaces",
373373
"name": "Workspaces",
374374
"icon": "$(squirrel)",
375-
"when": "gitpod.authenticated == true && !gitpod.inGpNextRemoteWindow"
375+
"when": "gitpod.authenticated == true && !gitpod.inGitpodFlexRemoteWindow"
376376
},
377377
{
378378
"id": "gitpod-workspace",
@@ -385,7 +385,7 @@
385385
"viewsWelcome": [
386386
{
387387
"view": "gitpod-login",
388-
"when": "gitpod.authenticated != true && !gitpod.inGpNextRemoteWindow",
388+
"when": "gitpod.authenticated != true && !gitpod.inGitpodFlexRemoteWindow",
389389
"contents": "You have not yet signed in with Gitpod\n[Sign in](command:gitpod.signIn)"
390390
}
391391
]

src/extension.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { NotificationService } from './services/notificationService';
1313
import { RemoteConnector } from './remoteConnector';
1414
import { TelemetryService } from './services/telemetryService';
1515
import { RemoteSession } from './remoteSession';
16-
import { SSHConnectionParams, getGitpodRemoteWindowConnectionInfo, isGitpodNextRemoteWindow } from './remote';
16+
import { SSHConnectionParams, getGitpodRemoteWindowConnectionInfo, isGitpodFlexRemoteWindow } from './remote';
1717
import { HostService } from './services/hostService';
1818
import { SessionService } from './services/sessionService';
1919
import { CommandManager } from './commandManager';
@@ -45,8 +45,8 @@ export async function activate(context: vscode.ExtensionContext) {
4545
const extensionId = context.extension.id;
4646
const packageJSON = context.extension.packageJSON;
4747

48-
if (isGitpodNextRemoteWindow()) {
49-
vscode.commands.executeCommand('setContext', 'gitpod.inGpNextRemoteWindow', true);
48+
if (isGitpodFlexRemoteWindow()) {
49+
vscode.commands.executeCommand('setContext', 'gitpod.inGitpodFlexRemoteWindow', true);
5050
return;
5151
}
5252

src/remote.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function getGitpodRemoteWindowConnectionInfo(context: vscode.ExtensionCon
7070
return undefined;
7171
}
7272

73-
export function isGitpodNextRemoteWindow() {
73+
export function isGitpodFlexRemoteWindow() {
7474
const remoteUri = vscode.workspace.workspaceFile?.scheme !== 'untitled'
7575
? vscode.workspace.workspaceFile || vscode.workspace.workspaceFolders?.[0].uri
7676
: vscode.workspace.workspaceFolders?.[0].uri;
@@ -96,6 +96,15 @@ export function isGitpodNextRemoteWindow() {
9696

9797
return /gitpod\.(local|remote)$/.test(sshDest.hostname);
9898
}
99+
if (vscode.env.remoteName === 'ssh-remote') {
100+
const [, sshEncoded] = remoteUri.authority.split('+');
101+
if (!sshEncoded) {
102+
return;
103+
}
104+
const sshDest = SSHDestination.fromRemoteSSHString(sshEncoded);
105+
106+
return /gitpod\.(local|remote)$/.test(sshDest.hostname);
107+
}
99108
return false;
100109
}
101110

0 commit comments

Comments
 (0)