Skip to content

Commit

Permalink
SCM - do not show "Open in External Terminal" action when connected t…
Browse files Browse the repository at this point in the history
…o a remote (#236697)
  • Loading branch information
lszomoru authored Dec 20, 2024
1 parent 1b43b07 commit 502a7e5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/vs/workbench/contrib/scm/browser/scm.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { SCMHistoryViewPane } from './scmHistoryViewPane.js';
import { QuickDiffModelService, IQuickDiffModelService } from './quickDiffModel.js';
import { QuickDiffEditorController } from './quickDiffWidget.js';
import { EditorContributionInstantiation, registerEditorContribution } from '../../../../editor/browser/editorExtensions.js';
import { RemoteNameContext } from '../../../common/contextkeys.js';

ModesRegistry.registerLanguage({
id: 'scminput',
Expand Down Expand Up @@ -529,7 +530,12 @@ MenuRegistry.appendMenuItem(MenuId.SCMSourceControl, {
id: 'scm.openInTerminal',
title: localize('open in external terminal', "Open in External Terminal")
},
when: ContextKeyExpr.and(ContextKeyExpr.equals('scmProviderHasRootUri', true), ContextKeyExpr.or(ContextKeyExpr.equals('config.terminal.sourceControlRepositoriesKind', 'external'), ContextKeyExpr.equals('config.terminal.sourceControlRepositoriesKind', 'both')))
when: ContextKeyExpr.and(
RemoteNameContext.isEqualTo(''),
ContextKeyExpr.equals('scmProviderHasRootUri', true),
ContextKeyExpr.or(
ContextKeyExpr.equals('config.terminal.sourceControlRepositoriesKind', 'external'),
ContextKeyExpr.equals('config.terminal.sourceControlRepositoriesKind', 'both')))
});

MenuRegistry.appendMenuItem(MenuId.SCMSourceControl, {
Expand All @@ -538,7 +544,11 @@ MenuRegistry.appendMenuItem(MenuId.SCMSourceControl, {
id: 'scm.openInIntegratedTerminal',
title: localize('open in integrated terminal', "Open in Integrated Terminal")
},
when: ContextKeyExpr.and(ContextKeyExpr.equals('scmProviderHasRootUri', true), ContextKeyExpr.or(ContextKeyExpr.equals('config.terminal.sourceControlRepositoriesKind', 'integrated'), ContextKeyExpr.equals('config.terminal.sourceControlRepositoriesKind', 'both')))
when: ContextKeyExpr.and(
ContextKeyExpr.equals('scmProviderHasRootUri', true),
ContextKeyExpr.or(
ContextKeyExpr.equals('config.terminal.sourceControlRepositoriesKind', 'integrated'),
ContextKeyExpr.equals('config.terminal.sourceControlRepositoriesKind', 'both')))
});

KeybindingsRegistry.registerCommandAndKeybindingRule({
Expand Down

0 comments on commit 502a7e5

Please sign in to comment.