Skip to content

Commit a0bc15f

Browse files
committed
Close Remote Connection shows up in local windows
1 parent fe1eafc commit a0bc15f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/vs/workbench/contrib/remote/browser/remoteIndicator.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { MenuId, IMenuService, MenuItemAction, MenuRegistry, registerAction2, Ac
1212
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
1313
import { StatusbarAlignment, IStatusbarService, IStatusbarEntryAccessor, IStatusbarEntry } from 'vs/workbench/services/statusbar/common/statusbar';
1414
import { ILabelService } from 'vs/platform/label/common/label';
15-
import { IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
15+
import { ContextKeyExpr, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
1616
import { ICommandService } from 'vs/platform/commands/common/commands';
1717
import { Schemas } from 'vs/base/common/network';
1818
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
@@ -34,6 +34,7 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
3434
import { IExtensionsViewPaneContainer, LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID, VIEWLET_ID } from 'vs/workbench/contrib/extensions/common/extensions';
3535
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
3636
import { IMarkdownString } from 'vs/base/common/htmlContent';
37+
import { RemoteNameContext, VirtualWorkspaceContext } from 'vs/workbench/browser/contextkeys';
3738

3839

3940
type ActionGroup = [string, Array<MenuItemAction | SubmenuItemAction>];
@@ -120,7 +121,8 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
120121
id: RemoteStatusIndicator.CLOSE_REMOTE_COMMAND_ID,
121122
category,
122123
title: { value: nls.localize('remote.close', "Close Remote Connection"), original: 'Close Remote Connection' },
123-
f1: true
124+
f1: true,
125+
precondition: ContextKeyExpr.or(RemoteNameContext, VirtualWorkspaceContext)
124126
});
125127
}
126128
run = () => that.hostService.openWindow({ forceReuseWindow: true, remoteAuthority: null });

0 commit comments

Comments
 (0)