diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index ddf40c760cc..6cd875992d2 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -17,7 +17,7 @@ import { ExtHostDocumentsAndEditors, IExtHostDocumentsAndEditors } from 'vs/work import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; import { BaseExtHostTerminalService, ExtHostTerminal } from 'vs/workbench/api/common/extHostTerminalService'; import { ExtHostWorkspace, IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; -import { ITerminalProfile, TERMINAL_SETTING_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { ITerminalProfile, TerminalSettingId } from 'vs/workbench/contrib/terminal/common/terminal'; import * as terminalEnvironment from 'vs/workbench/contrib/terminal/common/terminalEnvironment'; import { detectAvailableProfiles } from 'vs/workbench/contrib/terminal/node/terminalProfiles'; import type * as vscode from 'vscode'; @@ -134,7 +134,7 @@ export class ExtHostTerminalService extends BaseExtHostTerminalService { private _buildSafeConfigProvider(configProvider: ExtHostConfigProvider): SafeConfigProvider { const config = configProvider.getConfiguration(); return (key: string) => { - const isWorkspaceConfigAllowed = config.get(TERMINAL_SETTING_ID.AllowWorkspaceConfiguration); + const isWorkspaceConfigAllowed = config.get(TerminalSettingId.AllowWorkspaceConfiguration); if (isWorkspaceConfigAllowed) { return config.get(key) as any; } diff --git a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts index f1bc1a55ff5..bd65126480c 100644 --- a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts +++ b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts @@ -27,7 +27,7 @@ import Constants from 'vs/workbench/contrib/markers/browser/constants'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; -import { ITerminalProfileResolverService, TERMINAL_SETTING_ID, TERMINAL_VIEW_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { ITerminalProfileResolverService, TerminalSettingId, TERMINAL_VIEW_ID } from 'vs/workbench/contrib/terminal/common/terminal'; import { ITerminalService, ITerminalInstance } from 'vs/workbench/contrib/terminal/browser/terminal'; import { IOutputService } from 'vs/workbench/contrib/output/common/output'; import { StartStopProblemCollector, WatchingProblemCollector, ProblemCollectorEventKind, ProblemHandlingStrategy } from 'vs/workbench/contrib/tasks/common/problemCollectors'; @@ -1074,7 +1074,7 @@ export class TerminalTaskSystem implements ITaskSystem { // Under Mac remove -l to not start it as a login shell. if (platform === Platform.Platform.Mac) { // Background on -l on osx https://github.com/microsoft/vscode/issues/107563 - const osxShellArgs = this.configurationService.inspect(TERMINAL_SETTING_ID.ShellArgsMacOs); + const osxShellArgs = this.configurationService.inspect(TerminalSettingId.ShellArgsMacOs); if ((osxShellArgs.user === undefined) && (osxShellArgs.userLocal === undefined) && (osxShellArgs.userLocalValue === undefined) && (osxShellArgs.userRemote === undefined) && (osxShellArgs.userRemoteValue === undefined) && (osxShellArgs.userValue === undefined) && (osxShellArgs.workspace === undefined) diff --git a/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.ts b/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.ts index 456ab8e244a..4b2b0bdc426 100644 --- a/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.ts +++ b/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { EnvironmentVariableMutatorType, IEnvironmentVariableInfo, IMergedEnvironmentVariableCollection, IMergedEnvironmentVariableCollectionDiff } from 'vs/workbench/contrib/terminal/common/environmentVariable'; -import { TERMINAL_COMMAND_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { TerminalCommandId } from 'vs/workbench/contrib/terminal/common/terminal'; import { ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal'; import { localize } from 'vs/nls'; import { ThemeIcon } from 'vs/platform/theme/common/themeService'; @@ -64,7 +64,7 @@ export class EnvironmentVariableInfoStale implements IEnvironmentVariableInfo { return [{ label: localize('relaunchTerminalLabel', "Relaunch terminal"), run: () => this._terminalService.getInstanceFromId(this._terminalId)?.relaunch(), - commandId: TERMINAL_COMMAND_ID.Relaunch + commandId: TerminalCommandId.Relaunch }]; } } diff --git a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts index ff2b18bd942..004ee4614b1 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts @@ -18,7 +18,7 @@ import { getQuickNavigateHandler } from 'vs/workbench/browser/quickaccess'; import { Extensions as ViewContainerExtensions, IViewContainersRegistry, ViewContainerLocation, IViewsRegistry } from 'vs/workbench/common/views'; import { registerTerminalActions, terminalSendSequenceCommand } from 'vs/workbench/contrib/terminal/browser/terminalActions'; import { TerminalViewPane } from 'vs/workbench/contrib/terminal/browser/terminalView'; -import { KEYBINDING_CONTEXT_TERMINAL_SHELL_TYPE_KEY, KEYBINDING_CONTEXT_TERMINAL_FOCUS, TERMINAL_VIEW_ID, TERMINAL_COMMAND_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { KEYBINDING_CONTEXT_TERMINAL_SHELL_TYPE_KEY, KEYBINDING_CONTEXT_TERMINAL_FOCUS, TERMINAL_VIEW_ID, TerminalCommandId } from 'vs/workbench/contrib/terminal/common/terminal'; import { registerColors } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry'; import { setupTerminalCommands } from 'vs/workbench/contrib/terminal/browser/terminalCommands'; import { IConfigurationRegistry, Extensions } from 'vs/platform/configuration/common/configurationRegistry'; @@ -82,7 +82,7 @@ Registry.as(ViewContainerExtensions.ViewsRegistry).registerViews canMoveView: true, ctorDescriptor: new SyncDescriptor(TerminalViewPane), openCommandActionDescriptor: { - id: TERMINAL_COMMAND_ID.Toggle, + id: TerminalCommandId.Toggle, mnemonicTitle: nls.localize({ key: 'miToggleIntegratedTerminal', comment: ['&& denotes a mnemonic'] }, "&&Terminal"), keybindings: { primary: KeyMod.CtrlCmd | KeyCode.US_BACKTICK, @@ -97,7 +97,7 @@ registerTerminalActions(); function registerSendSequenceKeybinding(text: string, rule: { when?: ContextKeyExpression } & IKeybindings): void { KeybindingsRegistry.registerCommandAndKeybindingRule({ - id: TERMINAL_COMMAND_ID.SendSequence, + id: TerminalCommandId.SendSequence, weight: KeybindingWeight.WorkbenchContrib, when: rule.when || KEYBINDING_CONTEXT_TERMINAL_FOCUS, primary: rule.primary, diff --git a/src/vs/workbench/contrib/terminal/browser/terminal.web.contribution.ts b/src/vs/workbench/contrib/terminal/browser/terminal.web.contribution.ts index 0c249d92fc4..79728c55919 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminal.web.contribution.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminal.web.contribution.ts @@ -5,7 +5,7 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { KeybindingWeight, KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ITerminalProfileResolverService, TERMINAL_COMMAND_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { ITerminalProfileResolverService, TerminalCommandId } from 'vs/workbench/contrib/terminal/common/terminal'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { BrowserTerminalProfileResolverService } from 'vs/workbench/contrib/terminal/browser/terminalProfileResolverService'; @@ -14,7 +14,7 @@ registerSingleton(ITerminalProfileResolverService, BrowserTerminalProfileResolve // Register standard external terminal keybinding as integrated terminal when in web as the // external terminal is not available KeybindingsRegistry.registerKeybindingRule({ - id: TERMINAL_COMMAND_ID.New, + id: TerminalCommandId.New, weight: KeybindingWeight.WorkbenchContrib, when: undefined, primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_C diff --git a/src/vs/workbench/contrib/terminal/browser/terminalActions.ts b/src/vs/workbench/contrib/terminal/browser/terminalActions.ts index 82148c53dc7..73a6c16929e 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalActions.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalActions.ts @@ -32,7 +32,7 @@ import { PICK_WORKSPACE_FOLDER_COMMAND_ID } from 'vs/workbench/browser/actions/w import { FindInFilesCommand, IFindInFilesArgs } from 'vs/workbench/contrib/search/browser/searchActions'; import { Direction, IRemoteTerminalService, ITerminalInstance, ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal'; import { TerminalQuickAccessProvider } from 'vs/workbench/contrib/terminal/browser/terminalQuickAccess'; -import { IRemoteTerminalAttachTarget, ITerminalConfigHelper, ITerminalProfile, KEYBINDING_CONTEXT_TERMINAL_A11Y_TREE_FOCUS, KEYBINDING_CONTEXT_TERMINAL_ALT_BUFFER_ACTIVE, KEYBINDING_CONTEXT_TERMINAL_FIND_FOCUSED, KEYBINDING_CONTEXT_TERMINAL_FIND_NOT_VISIBLE, KEYBINDING_CONTEXT_TERMINAL_FIND_VISIBLE, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_IS_OPEN, KEYBINDING_CONTEXT_TERMINAL_PROCESS_SUPPORTED, KEYBINDING_CONTEXT_TERMINAL_TABS_FOCUS, KEYBINDING_CONTEXT_TERMINAL_TABS_SINGULAR_SELECTION, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_ACTION_CATEGORY, TERMINAL_COMMAND_ID, TERMINAL_SETTING_ID, TERMINAL_VIEW_ID, TitleEventSource } from 'vs/workbench/contrib/terminal/common/terminal'; +import { IRemoteTerminalAttachTarget, ITerminalConfigHelper, ITerminalProfile, KEYBINDING_CONTEXT_TERMINAL_A11Y_TREE_FOCUS, KEYBINDING_CONTEXT_TERMINAL_ALT_BUFFER_ACTIVE, KEYBINDING_CONTEXT_TERMINAL_FIND_FOCUSED, KEYBINDING_CONTEXT_TERMINAL_FIND_NOT_VISIBLE, KEYBINDING_CONTEXT_TERMINAL_FIND_VISIBLE, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_IS_OPEN, KEYBINDING_CONTEXT_TERMINAL_PROCESS_SUPPORTED, KEYBINDING_CONTEXT_TERMINAL_TABS_FOCUS, KEYBINDING_CONTEXT_TERMINAL_TABS_SINGULAR_SELECTION, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_ACTION_CATEGORY, TerminalCommandId, TerminalSettingId, TERMINAL_VIEW_ID, TitleEventSource } from 'vs/workbench/contrib/terminal/common/terminal'; import { ITerminalContributionService } from 'vs/workbench/contrib/terminal/common/terminalExtensionPoints'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; import { IHistoryService } from 'vs/workbench/services/history/common/history'; @@ -105,7 +105,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.NewInActiveWorkspace, + id: TerminalCommandId.NewInActiveWorkspace, title: { value: localize('workbench.action.terminal.newInActiveWorkspace', "Create New Integrated Terminal (In Active Workspace)"), original: 'Create New Integrated Terminal (In Active Workspace)' }, f1: true, category @@ -126,7 +126,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.NewWithProfile, + id: TerminalCommandId.NewWithProfile, title: { value: localize('workbench.action.terminal.newWithProfile', "Create New Integrated Terminal (With Profile)"), original: 'Create New Integrated Terminal (With Profile)' }, f1: true, category, @@ -195,7 +195,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ShowTabs, + id: TerminalCommandId.ShowTabs, title: { value: localize('workbench.action.terminal.showTabs', "Show Tabs"), original: 'Show Tabs' }, f1: false, category, @@ -211,7 +211,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.FocusPreviousPane, + id: TerminalCommandId.FocusPreviousPane, title: { value: localize('workbench.action.terminal.focusPreviousPane', "Focus Previous Pane"), original: 'Focus Previous Pane' }, f1: true, category, @@ -237,7 +237,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.FocusNextPane, + id: TerminalCommandId.FocusNextPane, title: { value: localize('workbench.action.terminal.focusNextPane', "Focus Next Pane"), original: 'Focus Next Pane' }, f1: true, category, @@ -263,7 +263,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ResizePaneLeft, + id: TerminalCommandId.ResizePaneLeft, title: { value: localize('workbench.action.terminal.resizePaneLeft', "Resize Pane Left"), original: 'Resize Pane Left' }, f1: true, category, @@ -283,7 +283,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ResizePaneRight, + id: TerminalCommandId.ResizePaneRight, title: { value: localize('workbench.action.terminal.resizePaneRight', "Resize Pane Right"), original: 'Resize Pane Right' }, f1: true, category, @@ -303,7 +303,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ResizePaneUp, + id: TerminalCommandId.ResizePaneUp, title: { value: localize('workbench.action.terminal.resizePaneUp', "Resize Pane Up"), original: 'Resize Pane Up' }, f1: true, category, @@ -322,7 +322,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ResizePaneDown, + id: TerminalCommandId.ResizePaneDown, title: { value: localize('workbench.action.terminal.resizePaneDown', "Resize Pane Down"), original: 'Resize Pane Down' }, f1: true, category, @@ -341,7 +341,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.Focus, + id: TerminalCommandId.Focus, title: { value: localize('workbench.action.terminal.focus', "Focus Terminal"), original: 'Focus Terminal' }, f1: true, category, @@ -353,20 +353,20 @@ export function registerTerminalActions() { order: 0, when: ContextKeyAndExpr.create([ ContextKeyEqualsExpr.create('view', TERMINAL_VIEW_ID), - ContextKeyExpr.has(`config.${TERMINAL_SETTING_ID.TabsEnabled}`), + ContextKeyExpr.has(`config.${TerminalSettingId.TabsEnabled}`), ContextKeyExpr.or( ContextKeyExpr.and( - ContextKeyExpr.equals(`config.${TERMINAL_SETTING_ID.TabsShowActiveTerminal}`, 'singleTerminal'), + ContextKeyExpr.equals(`config.${TerminalSettingId.TabsShowActiveTerminal}`, 'singleTerminal'), ContextKeyExpr.equals('terminalCount', 1) ), ContextKeyExpr.and( - ContextKeyExpr.equals(`config.${TERMINAL_SETTING_ID.TabsShowActiveTerminal}`, 'singleTerminalOrNarrow'), + ContextKeyExpr.equals(`config.${TerminalSettingId.TabsShowActiveTerminal}`, 'singleTerminalOrNarrow'), ContextKeyExpr.or( ContextKeyExpr.equals('terminalCount', 1), ContextKeyExpr.has('isTerminalTabsNarrow') ) ), - ContextKeyExpr.equals(`config.${TERMINAL_SETTING_ID.TabsShowActiveTerminal}`, 'always') + ContextKeyExpr.equals(`config.${TerminalSettingId.TabsShowActiveTerminal}`, 'always') ) ]), } @@ -385,7 +385,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.FocusTabs, + id: TerminalCommandId.FocusTabs, title: { value: localize('workbench.action.terminal.focus.tabsView', "Focus Terminal Tabs View"), original: 'Focus Terminal Tabs View' }, f1: true, category, @@ -404,7 +404,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.FocusNext, + id: TerminalCommandId.FocusNext, title: { value: localize('workbench.action.terminal.focusNext', "Focus Next Terminal"), original: 'Focus Next Terminal' }, f1: true, category, @@ -428,7 +428,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.FocusPrevious, + id: TerminalCommandId.FocusPrevious, title: { value: localize('workbench.action.terminal.focusPrevious', "Focus Previous Terminal"), original: 'Focus Previous Terminal' }, f1: true, category, @@ -452,7 +452,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.RunSelectedText, + id: TerminalCommandId.RunSelectedText, title: { value: localize('workbench.action.terminal.runSelectedText', "Run Selected Text In Active Terminal"), original: 'Run Selected Text In Active Terminal' }, f1: true, category, @@ -483,7 +483,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.RunActiveFile, + id: TerminalCommandId.RunActiveFile, title: { value: localize('workbench.action.terminal.runActiveFile', "Run Active File In Active Terminal"), original: 'Run Active File In Active Terminal' }, f1: true, category, @@ -516,7 +516,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ScrollDownLine, + id: TerminalCommandId.ScrollDownLine, title: { value: localize('workbench.action.terminal.scrollDown', "Scroll Down (Line)"), original: 'Scroll Down (Line)' }, f1: true, category, @@ -536,7 +536,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ScrollDownPage, + id: TerminalCommandId.ScrollDownPage, title: { value: localize('workbench.action.terminal.scrollDownPage', "Scroll Down (Page)"), original: 'Scroll Down (Page)' }, f1: true, category, @@ -556,7 +556,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ScrollToBottom, + id: TerminalCommandId.ScrollToBottom, title: { value: localize('workbench.action.terminal.scrollToBottom', "Scroll to Bottom"), original: 'Scroll to Bottom' }, f1: true, category, @@ -576,7 +576,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ScrollUpLine, + id: TerminalCommandId.ScrollUpLine, title: { value: localize('workbench.action.terminal.scrollUp', "Scroll Up (Line)"), original: 'Scroll Up (Line)' }, f1: true, category, @@ -596,7 +596,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ScrollUpPage, + id: TerminalCommandId.ScrollUpPage, title: { value: localize('workbench.action.terminal.scrollUpPage', "Scroll Up (Page)"), original: 'Scroll Up (Page)' }, f1: true, category, @@ -616,7 +616,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ScrollToTop, + id: TerminalCommandId.ScrollToTop, title: { value: localize('workbench.action.terminal.scrollToTop', "Scroll to Top"), original: 'Scroll to Top' }, f1: true, category, @@ -636,7 +636,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.NavigationModeExit, + id: TerminalCommandId.NavigationModeExit, title: { value: localize('workbench.action.terminal.navigationModeExit', "Exit Navigation Mode"), original: 'Exit Navigation Mode' }, f1: true, category, @@ -655,7 +655,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.NavigationModeFocusPrevious, + id: TerminalCommandId.NavigationModeFocusPrevious, title: { value: localize('workbench.action.terminal.navigationModeFocusPrevious', "Focus Previous Line (Navigation Mode)"), original: 'Focus Previous Line (Navigation Mode)' }, f1: true, category, @@ -677,7 +677,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.NavigationModeFocusNext, + id: TerminalCommandId.NavigationModeFocusNext, title: { value: localize('workbench.action.terminal.navigationModeFocusNext', "Focus Next Line (Navigation Mode)"), original: 'Focus Next Line (Navigation Mode)' }, f1: true, category, @@ -699,7 +699,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ClearSelection, + id: TerminalCommandId.ClearSelection, title: { value: localize('workbench.action.terminal.clearSelection', "Clear Selection"), original: 'Clear Selection' }, f1: true, category, @@ -721,7 +721,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ChangeIcon, + id: TerminalCommandId.ChangeIcon, title: { value: localize('workbench.action.terminal.changeIcon', "Change Icon..."), original: 'Change Icon...' }, f1: true, category, @@ -735,7 +735,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ChangeIconInstance, + id: TerminalCommandId.ChangeIconInstance, title: { value: localize('workbench.action.terminal.changeIcon', "Change Icon..."), original: 'Change Icon...' }, f1: false, category, @@ -749,7 +749,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.Rename, + id: TerminalCommandId.Rename, title: { value: localize('workbench.action.terminal.rename', "Rename..."), original: 'Rename...' }, f1: true, category, @@ -763,7 +763,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.RenameInstance, + id: TerminalCommandId.RenameInstance, title: { value: localize('workbench.action.terminal.renameInstance', "Rename..."), original: 'Rename...' }, f1: false, category, @@ -785,7 +785,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.FindFocus, + id: TerminalCommandId.FindFocus, title: { value: localize('workbench.action.terminal.focusFind', "Focus Find"), original: 'Focus Find' }, f1: true, category, @@ -804,7 +804,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.FindHide, + id: TerminalCommandId.FindHide, title: { value: localize('workbench.action.terminal.hideFind', "Hide Find"), original: 'Hide Find' }, f1: true, category, @@ -824,7 +824,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.AttachToRemoteTerminal, + id: TerminalCommandId.AttachToRemoteTerminal, title: { value: localize('workbench.action.terminal.attachToRemote', "Attach to Session"), original: 'Attach to Session' }, f1: true, category @@ -867,7 +867,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.QuickOpenTerm, + id: TerminalCommandId.QuickOpenTerm, title: { value: localize('quickAccessTerminal', "Switch Active Terminal"), original: 'Switch Active Terminal' }, f1: true, category, @@ -881,7 +881,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ScrollToPreviousCommand, + id: TerminalCommandId.ScrollToPreviousCommand, title: { value: localize('workbench.action.terminal.scrollToPreviousCommand', "Scroll To Previous Command"), original: 'Scroll To Previous Command' }, f1: true, category, @@ -903,7 +903,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ScrollToNextCommand, + id: TerminalCommandId.ScrollToNextCommand, title: { value: localize('workbench.action.terminal.scrollToNextCommand', "Scroll To Next Command"), original: 'Scroll To Next Command' }, f1: true, category, @@ -925,7 +925,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.SelectToPreviousCommand, + id: TerminalCommandId.SelectToPreviousCommand, title: { value: localize('workbench.action.terminal.selectToPreviousCommand', "Select To Previous Command"), original: 'Select To Previous Command' }, f1: true, category, @@ -947,7 +947,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.SelectToNextCommand, + id: TerminalCommandId.SelectToNextCommand, title: { value: localize('workbench.action.terminal.selectToNextCommand', "Select To Next Command"), original: 'Select To Next Command' }, f1: true, category, @@ -969,7 +969,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.SelectToPreviousLine, + id: TerminalCommandId.SelectToPreviousLine, title: { value: localize('workbench.action.terminal.selectToPreviousLine', "Select To Previous Line"), original: 'Select To Previous Line' }, f1: true, category, @@ -986,7 +986,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.SelectToNextLine, + id: TerminalCommandId.SelectToNextLine, title: { value: localize('workbench.action.terminal.selectToNextLine', "Select To Next Line"), original: 'Select To Next Line' }, f1: true, category, @@ -1003,7 +1003,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ToggleEscapeSequenceLogging, + id: TerminalCommandId.ToggleEscapeSequenceLogging, title: { value: localize('workbench.action.terminal.toggleEscapeSequenceLogging', "Toggle Escape Sequence Logging"), original: 'Toggle Escape Sequence Logging' }, f1: true, category, @@ -1018,7 +1018,7 @@ export function registerTerminalActions() { constructor() { const title = localize('workbench.action.terminal.sendSequence', "Send Custom Sequence To Terminal"); super({ - id: TERMINAL_COMMAND_ID.SendSequence, + id: TerminalCommandId.SendSequence, title: { value: title, original: 'Send Custom Sequence To Terminal' }, category, description: { @@ -1045,7 +1045,7 @@ export function registerTerminalActions() { constructor() { const title = localize('workbench.action.terminal.newWithCwd', "Create New Integrated Terminal Starting in a Custom Working Directory"); super({ - id: TERMINAL_COMMAND_ID.NewWithCwd, + id: TerminalCommandId.NewWithCwd, title: { value: title, original: 'Create New Integrated Terminal Starting in a Custom Working Directory' }, category, description: { @@ -1083,7 +1083,7 @@ export function registerTerminalActions() { constructor() { const title = localize('workbench.action.terminal.renameWithArg', "Rename the Currently Active Terminal"); super({ - id: TERMINAL_COMMAND_ID.RenameWithArgs, + id: TerminalCommandId.RenameWithArgs, title: { value: title, original: 'Rename the Currently Active Terminal' }, category, description: { @@ -1118,7 +1118,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ToggleFindRegex, + id: TerminalCommandId.ToggleFindRegex, title: { value: localize('workbench.action.terminal.toggleFindRegex', "Toggle Find Using Regex"), original: 'Toggle Find Using Regex' }, f1: true, category, @@ -1139,7 +1139,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ToggleFindWholeWord, + id: TerminalCommandId.ToggleFindWholeWord, title: { value: localize('workbench.action.terminal.toggleFindWholeWord', "Toggle Find Using Whole Word"), original: 'Toggle Find Using Whole Word' }, f1: true, category, @@ -1160,7 +1160,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ToggleFindCaseSensitive, + id: TerminalCommandId.ToggleFindCaseSensitive, title: { value: localize('workbench.action.terminal.toggleFindCaseSensitive', "Toggle Find Using Case Sensitive"), original: 'Toggle Find Using Case Sensitive' }, f1: true, category, @@ -1181,7 +1181,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.FindNext, + id: TerminalCommandId.FindNext, title: { value: localize('workbench.action.terminal.findNext', "Find Next"), original: 'Find Next' }, f1: true, category, @@ -1208,7 +1208,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.FindPrevious, + id: TerminalCommandId.FindPrevious, title: { value: localize('workbench.action.terminal.findPrevious', "Find Previous"), original: 'Find Previous' }, f1: true, category, @@ -1235,7 +1235,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.SearchWorkspace, + id: TerminalCommandId.SearchWorkspace, title: { value: localize('workbench.action.terminal.searchWorkspace', "Search Workspace"), original: 'Search Workspace' }, f1: true, category, @@ -1257,7 +1257,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.Relaunch, + id: TerminalCommandId.Relaunch, title: { value: localize('workbench.action.terminal.relaunch', "Relaunch Active Terminal"), original: 'Relaunch Active Terminal' }, f1: true, category, @@ -1271,7 +1271,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ShowEnvironmentInformation, + id: TerminalCommandId.ShowEnvironmentInformation, title: { value: localize('workbench.action.terminal.showEnvironmentInformation', "Show Environment Information"), original: 'Show Environment Information' }, f1: true, category, @@ -1285,7 +1285,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.Split, + id: TerminalCommandId.Split, title: { value: localize('workbench.action.terminal.split', "Split Terminal"), original: 'Split Terminal' }, f1: true, category, @@ -1326,7 +1326,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.SplitInstance, + id: TerminalCommandId.SplitInstance, title: { value: localize('workbench.action.terminal.split', "Split Terminal"), original: 'Split Terminal' }, f1: false, category, @@ -1356,7 +1356,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.SplitInActiveWorkspace, + id: TerminalCommandId.SplitInActiveWorkspace, title: { value: localize('workbench.action.terminal.splitInActiveWorkspace', "Split Terminal (In Active Workspace)"), original: 'Split Terminal (In Active Workspace)' }, f1: true, category, @@ -1375,7 +1375,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.SelectAll, + id: TerminalCommandId.SelectAll, title: { value: localize('workbench.action.terminal.selectAll', "Select All"), original: 'Select All' }, f1: true, category, @@ -1400,7 +1400,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.New, + id: TerminalCommandId.New, title: { value: localize('workbench.action.terminal.new', "Create New Integrated Terminal"), original: 'Create New Integrated Terminal' }, f1: true, category, @@ -1452,7 +1452,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.Kill, + id: TerminalCommandId.Kill, title: { value: localize('workbench.action.terminal.kill', "Kill the Active Terminal Instance"), original: 'Kill the Active Terminal Instance' }, f1: true, category, @@ -1464,7 +1464,7 @@ export function registerTerminalActions() { order: 3, when: ContextKeyAndExpr.create([ ContextKeyEqualsExpr.create('view', TERMINAL_VIEW_ID), - ContextKeyExpr.not(`config.${TERMINAL_SETTING_ID.TabsEnabled}`) + ContextKeyExpr.not(`config.${TerminalSettingId.TabsEnabled}`) ]) } }); @@ -1483,7 +1483,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.KillInstance, + id: TerminalCommandId.KillInstance, title: { value: localize('workbench.action.terminal.kill.short', "Kill Terminal"), original: 'Kill Terminal' }, @@ -1513,7 +1513,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.Clear, + id: TerminalCommandId.Clear, title: { value: localize('workbench.action.terminal.clear', "Clear"), original: 'Clear' }, f1: true, category, @@ -1538,7 +1538,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.SelectDefaultProfile, + id: TerminalCommandId.SelectDefaultProfile, title: { value: localize('workbench.action.terminal.selectDefaultProfile', "Select Default Profile"), original: 'Select Default Profile' }, f1: true, category, @@ -1553,8 +1553,8 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.CreateWithProfileButton, - title: TERMINAL_COMMAND_ID.CreateWithProfileButton, + id: TerminalCommandId.CreateWithProfileButton, + title: TerminalCommandId.CreateWithProfileButton, f1: false, category, precondition: KEYBINDING_CONTEXT_TERMINAL_PROCESS_SUPPORTED, @@ -1575,7 +1575,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.ConfigureTerminalSettings, + id: TerminalCommandId.ConfigureTerminalSettings, title: { value: localize('workbench.action.terminal.openSettings', "Configure Terminal Settings"), original: 'Configure Terminal Settings' }, f1: true, category, @@ -1592,7 +1592,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.CopySelection, + id: TerminalCommandId.CopySelection, title: { value: localize('workbench.action.terminal.copySelection', "Copy Selection"), original: 'Copy Selection' }, f1: true, category, @@ -1617,7 +1617,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.Paste, + id: TerminalCommandId.Paste, title: { value: localize('workbench.action.terminal.paste', "Paste into Active Terminal"), original: 'Paste into Active Terminal' }, f1: true, category, @@ -1641,7 +1641,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.PasteSelection, + id: TerminalCommandId.PasteSelection, title: { value: localize('workbench.action.terminal.pasteSelection', "Paste Selection into Active Terminal"), original: 'Paste Selection into Active Terminal' }, f1: true, category, @@ -1663,7 +1663,7 @@ export function registerTerminalActions() { registerAction2(class extends Action2 { constructor() { super({ - id: TERMINAL_COMMAND_ID.SwitchTerminal, + id: TerminalCommandId.SwitchTerminal, title: switchTerminalTitle, f1: true, category, @@ -1682,7 +1682,7 @@ export function registerTerminalActions() { return Promise.resolve(null); } if (item === switchTerminalShowTabsTitle) { - accessor.get(IConfigurationService).updateValue(TERMINAL_SETTING_ID.TabsEnabled, true); + accessor.get(IConfigurationService).updateValue(TerminalSettingId.TabsEnabled, true); return; } const indexMatches = terminalIndexRe.exec(item); diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index 2b515588e28..b94747f56b7 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -24,7 +24,7 @@ import { activeContrastBorder, scrollbarSliderActiveBackground, scrollbarSliderB import { ICssStyleCollector, IColorTheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { PANEL_BACKGROUND, SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme'; import { TerminalWidgetManager } from 'vs/workbench/contrib/terminal/browser/widgets/widgetManager'; -import { ITerminalProcessManager, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, NEVER_MEASURE_RENDER_TIME_STORAGE_KEY, ProcessState, TERMINAL_VIEW_ID, KEYBINDING_CONTEXT_TERMINAL_A11Y_TREE_FOCUS, INavigationMode, TitleEventSource, DEFAULT_COMMANDS_TO_SKIP_SHELL, TERMINAL_CREATION_COMMANDS, KEYBINDING_CONTEXT_TERMINAL_ALT_BUFFER_ACTIVE, SUGGESTED_RENDERER_TYPE, ITerminalProfileResolverService, TERMINAL_SETTING_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { ITerminalProcessManager, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, NEVER_MEASURE_RENDER_TIME_STORAGE_KEY, ProcessState, TERMINAL_VIEW_ID, KEYBINDING_CONTEXT_TERMINAL_A11Y_TREE_FOCUS, INavigationMode, TitleEventSource, DEFAULT_COMMANDS_TO_SKIP_SHELL, TERMINAL_CREATION_COMMANDS, KEYBINDING_CONTEXT_TERMINAL_ALT_BUFFER_ACTIVE, SUGGESTED_RENDERER_TYPE, ITerminalProfileResolverService, TerminalSettingId } from 'vs/workbench/contrib/terminal/common/terminal'; import { ansiColorIdentifiers, TERMINAL_BACKGROUND_COLOR, TERMINAL_CURSOR_BACKGROUND_COLOR, TERMINAL_CURSOR_FOREGROUND_COLOR, TERMINAL_FOREGROUND_COLOR, TERMINAL_SELECTION_BACKGROUND_COLOR } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry'; import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/browser/terminalConfigHelper'; import { TerminalLinkManager } from 'vs/workbench/contrib/terminal/browser/links/terminalLinkManager'; @@ -290,13 +290,13 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { // supported. this.setVisible(this._isVisible); } - if (e.affectsConfiguration(TERMINAL_SETTING_ID.UnicodeVersion)) { + if (e.affectsConfiguration(TerminalSettingId.UnicodeVersion)) { this._updateUnicodeVersion(); } if (e.affectsConfiguration('editor.accessibilitySupport')) { this.updateAccessibilitySupport(); } - if (e.affectsConfiguration(TERMINAL_SETTING_ID.GpuAcceleration)) { + if (e.affectsConfiguration(TerminalSettingId.GpuAcceleration)) { this._storageService.remove(SUGGESTED_RENDERER_TYPE, StorageScope.GLOBAL); } })); @@ -660,7 +660,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { { label: nls.localize('configureTerminalSettings', "Configure Terminal Settings"), run: () => { - this._preferencesService.openSettings(false, `@id:${TERMINAL_SETTING_ID.CommandsToSkipShell},${TERMINAL_SETTING_ID.SendKeybindingsToShell},${TERMINAL_SETTING_ID.AllowChords}`); + this._preferencesService.openSettings(false, `@id:${TerminalSettingId.CommandsToSkipShell},${TerminalSettingId.SendKeybindingsToShell},${TerminalSettingId.AllowChords}`); } } as IPromptChoice ] @@ -761,7 +761,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { const promptChoices: IPromptChoice[] = [ { label: nls.localize('yes', "Yes"), - run: () => this._configurationService.updateValue(TERMINAL_SETTING_ID.GpuAcceleration, 'off', ConfigurationTarget.USER) + run: () => this._configurationService.updateValue(TerminalSettingId.GpuAcceleration, 'off', ConfigurationTarget.USER) } as IPromptChoice, { label: nls.localize('no', "No"), @@ -1135,7 +1135,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { } } - if (this._processManager.processState === ProcessState.KILLED_DURING_LAUNCH) { + if (this._processManager.processState === ProcessState.KilledDuringLaunch) { if (commandLine) { exitCodeMessage = nls.localize('launchFailed.exitCodeAndCommandLine', "The terminal process \"{0}\" failed to launch (exit code: {1}).", commandLine, this._exitCode); break; @@ -1159,7 +1159,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { // Only trigger wait on exit when the exit was *not* triggered by the // user (via the `workbench.action.terminal.kill` command). - if (this._shellLaunchConfig.waitOnExit && this._processManager.processState !== ProcessState.KILLED_BY_USER) { + if (this._shellLaunchConfig.waitOnExit && this._processManager.processState !== ProcessState.KilledByUser) { this._xtermReadyPromise.then(xterm => { if (exitCodeMessage) { xterm.writeln(exitCodeMessage); @@ -1176,7 +1176,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { } else { this.dispose(); if (exitCodeMessage) { - const failedDuringLaunch = this._processManager.processState === ProcessState.KILLED_DURING_LAUNCH; + const failedDuringLaunch = this._processManager.processState === ProcessState.KilledDuringLaunch; if (failedDuringLaunch || this._configHelper.config.showExitAlert) { // Always show launch failures this._notificationService.notify({ @@ -1324,7 +1324,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { } private async _onSelectionChange(): Promise { - if (this._configurationService.getValue(TERMINAL_SETTING_ID.CopyOnSelection)) { + if (this._configurationService.getValue(TerminalSettingId.CopyOnSelection)) { if (this.hasSelection()) { await this.copySelection(); } diff --git a/src/vs/workbench/contrib/terminal/browser/terminalMenus.ts b/src/vs/workbench/contrib/terminal/browser/terminalMenus.ts index cb0911e4454..2b6df368975 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalMenus.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalMenus.ts @@ -6,7 +6,7 @@ import { localize } from 'vs/nls'; import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { ContextKeyAndExpr, ContextKeyEqualsExpr, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { KEYBINDING_CONTEXT_TERMINAL_PROCESS_SUPPORTED, TERMINAL_COMMAND_ID, TERMINAL_SETTING_ID, TERMINAL_VIEW_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { KEYBINDING_CONTEXT_TERMINAL_PROCESS_SUPPORTED, TerminalCommandId, TerminalSettingId, TERMINAL_VIEW_ID } from 'vs/workbench/contrib/terminal/common/terminal'; const enum ContextMenuGroup { Create = '1_create', @@ -36,7 +36,7 @@ export function setupTerminalMenus(): void { id: MenuId.MenubarTerminalMenu, item: { group: TerminalMenuBarGroup.Create, command: { - id: TERMINAL_COMMAND_ID.New, + id: TerminalCommandId.New, title: localize({ key: 'miNewTerminal', comment: ['&& denotes a mnemonic'] }, "&&New Terminal") }, order: 1 @@ -46,7 +46,7 @@ export function setupTerminalMenus(): void { id: MenuId.MenubarTerminalMenu, item: { group: TerminalMenuBarGroup.Create, command: { - id: TERMINAL_COMMAND_ID.Split, + id: TerminalCommandId.Split, title: localize({ key: 'miSplitTerminal', comment: ['&& denotes a mnemonic'] }, "&&Split Terminal"), precondition: ContextKeyExpr.has('terminalIsOpen') }, @@ -58,7 +58,7 @@ export function setupTerminalMenus(): void { id: MenuId.MenubarTerminalMenu, item: { group: TerminalMenuBarGroup.Run, command: { - id: TERMINAL_COMMAND_ID.RunActiveFile, + id: TerminalCommandId.RunActiveFile, title: localize({ key: 'miRunActiveFile', comment: ['&& denotes a mnemonic'] }, "Run &&Active File") }, order: 3, @@ -69,7 +69,7 @@ export function setupTerminalMenus(): void { id: MenuId.MenubarTerminalMenu, item: { group: TerminalMenuBarGroup.Run, command: { - id: TERMINAL_COMMAND_ID.RunSelectedText, + id: TerminalCommandId.RunSelectedText, title: localize({ key: 'miRunSelectedText', comment: ['&& denotes a mnemonic'] }, "Run &&Selected Text") }, order: 4, @@ -85,7 +85,7 @@ export function setupTerminalMenus(): void { id: MenuId.TerminalInstanceContext, item: { group: ContextMenuGroup.Create, command: { - id: TERMINAL_COMMAND_ID.Split, + id: TerminalCommandId.Split, title: localize('workbench.action.terminal.split', "Split Terminal") } } @@ -93,7 +93,7 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalInstanceContext, item: { command: { - id: TERMINAL_COMMAND_ID.New, + id: TerminalCommandId.New, title: localize('workbench.action.terminal.new.short', "New Terminal") }, group: ContextMenuGroup.Create @@ -102,7 +102,7 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalInstanceContext, item: { command: { - id: TERMINAL_COMMAND_ID.Kill, + id: TerminalCommandId.Kill, title: localize('workbench.action.terminal.kill.short', "Kill Terminal") }, group: ContextMenuGroup.Kill @@ -111,7 +111,7 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalInstanceContext, item: { command: { - id: TERMINAL_COMMAND_ID.CopySelection, + id: TerminalCommandId.CopySelection, title: localize('workbench.action.terminal.copySelection.short', "Copy") }, group: ContextMenuGroup.Edit, @@ -121,7 +121,7 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalInstanceContext, item: { command: { - id: TERMINAL_COMMAND_ID.Paste, + id: TerminalCommandId.Paste, title: localize('workbench.action.terminal.paste.short', "Paste") }, group: ContextMenuGroup.Edit, @@ -131,7 +131,7 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalInstanceContext, item: { command: { - id: TERMINAL_COMMAND_ID.Clear, + id: TerminalCommandId.Clear, title: localize('workbench.action.terminal.clear', "Clear") }, group: ContextMenuGroup.Clear, @@ -140,17 +140,17 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalInstanceContext, item: { command: { - id: TERMINAL_COMMAND_ID.ShowTabs, + id: TerminalCommandId.ShowTabs, title: localize('workbench.action.terminal.showsTabs', "Show Tabs") }, - when: ContextKeyExpr.not(`config.${TERMINAL_SETTING_ID.TabsEnabled}`), + when: ContextKeyExpr.not(`config.${TerminalSettingId.TabsEnabled}`), group: ContextMenuGroup.Config } }, { id: MenuId.TerminalInstanceContext, item: { command: { - id: TERMINAL_COMMAND_ID.SelectAll, + id: TerminalCommandId.SelectAll, title: localize('workbench.action.terminal.selectAll', "Select All"), }, group: ContextMenuGroup.Edit, @@ -165,7 +165,7 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalTabEmptyAreaContext, item: { command: { - id: TERMINAL_COMMAND_ID.NewWithProfile, + id: TerminalCommandId.NewWithProfile, title: localize('workbench.action.terminal.newWithProfile.short', "New Terminal With Profile") }, group: ContextMenuGroup.Create @@ -174,7 +174,7 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalTabEmptyAreaContext, item: { command: { - id: TERMINAL_COMMAND_ID.New, + id: TerminalCommandId.New, title: localize('workbench.action.terminal.new.short', "New Terminal") }, group: ContextMenuGroup.Create @@ -188,7 +188,7 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalNewDropdownContext, item: { command: { - id: TERMINAL_COMMAND_ID.SelectDefaultProfile, + id: TerminalCommandId.SelectDefaultProfile, title: { value: localize('workbench.action.terminal.selectDefaultProfile', "Select Default Profile"), original: 'Select Default Profile' } }, group: TerminalTabContextMenuGroup.Configure @@ -197,7 +197,7 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalNewDropdownContext, item: { command: { - id: TERMINAL_COMMAND_ID.ConfigureTerminalSettings, + id: TerminalCommandId.ConfigureTerminalSettings, title: localize('workbench.action.terminal.openSettings', "Configure Terminal Settings") }, group: TerminalTabContextMenuGroup.Configure @@ -212,27 +212,27 @@ export function setupTerminalMenus(): void { id: MenuId.ViewTitle, item: { group: 'navigation', command: { - id: TERMINAL_COMMAND_ID.Split, + id: TerminalCommandId.Split, title: localize('workbench.action.terminal.split', "Split Terminal") }, order: 2, when: ContextKeyAndExpr.create([ ContextKeyEqualsExpr.create('view', TERMINAL_VIEW_ID), - ContextKeyExpr.not(`config.${TERMINAL_SETTING_ID.TabsEnabled}`) + ContextKeyExpr.not(`config.${TerminalSettingId.TabsEnabled}`) ]) } }, { id: MenuId.ViewTitle, item: { command: { - id: TERMINAL_COMMAND_ID.SwitchTerminal, + id: TerminalCommandId.SwitchTerminal, title: { value: localize('workbench.action.terminal.switchTerminal', "Switch Terminal"), original: 'Switch Terminal' } }, group: 'navigation', order: 0, when: ContextKeyAndExpr.create([ ContextKeyEqualsExpr.create('view', TERMINAL_VIEW_ID), - ContextKeyExpr.not(`config.${TERMINAL_SETTING_ID.TabsEnabled}`) + ContextKeyExpr.not(`config.${TerminalSettingId.TabsEnabled}`) ]), } } @@ -244,7 +244,7 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalInlineTabContext, item: { command: { - id: TERMINAL_COMMAND_ID.ChangeIcon, + id: TerminalCommandId.ChangeIcon, title: localize('workbench.action.terminal.changeIcon', "Change Icon...") }, group: ContextMenuGroup.Edit, @@ -254,7 +254,7 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalInlineTabContext, item: { command: { - id: TERMINAL_COMMAND_ID.Rename, + id: TerminalCommandId.Rename, title: localize('workbench.action.terminal.rename', "Rename...") } } @@ -262,7 +262,7 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalInlineTabContext, item: { command: { - id: TERMINAL_COMMAND_ID.RenameInstance, + id: TerminalCommandId.RenameInstance, title: localize('workbench.action.terminal.renameInstance', "Rename...") }, group: ContextMenuGroup.Edit @@ -272,7 +272,7 @@ export function setupTerminalMenus(): void { id: MenuId.TerminalInlineTabContext, item: { group: ContextMenuGroup.Create, command: { - id: TERMINAL_COMMAND_ID.Split, + id: TerminalCommandId.Split, title: localize('workbench.action.terminal.split', "Split Terminal") } } @@ -280,7 +280,7 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalInlineTabContext, item: { command: { - id: TERMINAL_COMMAND_ID.Kill, + id: TerminalCommandId.Kill, title: localize('workbench.action.terminal.kill.short', "Kill Terminal") }, group: ContextMenuGroup.Kill @@ -294,7 +294,7 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalTabContext, item: { command: { - id: TERMINAL_COMMAND_ID.RenameInstance, + id: TerminalCommandId.RenameInstance, title: localize('workbench.action.terminal.renameInstance', "Rename...") }, group: ContextMenuGroup.Edit @@ -303,7 +303,7 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalTabContext, item: { command: { - id: TERMINAL_COMMAND_ID.ChangeIconInstance, + id: TerminalCommandId.ChangeIconInstance, title: localize('workbench.action.terminal.changeIcon', "Change Icon...") }, group: ContextMenuGroup.Edit @@ -312,7 +312,7 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalTabContext, item: { command: { - id: TERMINAL_COMMAND_ID.SplitInstance, + id: TerminalCommandId.SplitInstance, title: localize('workbench.action.terminal.splitInstance', "Split Terminal"), }, group: ContextMenuGroup.Create @@ -321,7 +321,7 @@ export function setupTerminalMenus(): void { { id: MenuId.TerminalTabContext, item: { command: { - id: TERMINAL_COMMAND_ID.KillInstance, + id: TerminalCommandId.KillInstance, title: localize('workbench.action.terminal.killInstance', "Kill Terminal") }, group: ContextMenuGroup.Kill, diff --git a/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts b/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts index e5dae8ec91b..f2c337485b5 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as terminalEnvironment from 'vs/workbench/contrib/terminal/common/terminalEnvironment'; -import { ProcessState, ITerminalProcessManager, ITerminalConfigHelper, IBeforeProcessDataEvent, ITerminalProfileResolverService, ITerminalConfiguration, TERMINAL_CONFIG_SECTION, TERMINAL_SETTING_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { ProcessState, ITerminalProcessManager, ITerminalConfigHelper, IBeforeProcessDataEvent, ITerminalProfileResolverService, ITerminalConfiguration, TERMINAL_CONFIG_SECTION, TerminalSettingId } from 'vs/workbench/contrib/terminal/common/terminal'; import { ILogService } from 'vs/platform/log/common/log'; import { Emitter, Event } from 'vs/base/common/event'; import { IHistoryService } from 'vs/workbench/services/history/common/history'; @@ -52,7 +52,7 @@ enum ProcessType { * - Shell Process: The pseudoterminal child process (ie. the shell) */ export class TerminalProcessManager extends Disposable implements ITerminalProcessManager { - public processState: ProcessState = ProcessState.UNINITIALIZED; + public processState: ProcessState = ProcessState.Uninitialized; public ptyProcessReady: Promise; public shellProcessId: number | undefined; public remoteAuthority: string | undefined; @@ -152,7 +152,7 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce // If the process was still connected this dispose came from // within VS Code, not the process, so mark the process as // killed by the user. - this.processState = ProcessState.KILLED_BY_USER; + this.processState = ProcessState.KilledByUser; this._process.shutdown(immediate); this._process = null; } @@ -238,19 +238,19 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce }); const terminalConfig = this._configurationService.getValue(TERMINAL_CONFIG_SECTION); const configuration: ICompleteTerminalConfiguration = { - 'terminal.integrated.automationShell.windows': this._terminalProfileResolverService.getSafeConfigValueFullKey(TERMINAL_SETTING_ID.AutomationShellWindows) as string, - 'terminal.integrated.automationShell.osx': this._terminalProfileResolverService.getSafeConfigValueFullKey(TERMINAL_SETTING_ID.AutomationShellMacOs) as string, - 'terminal.integrated.automationShell.linux': this._terminalProfileResolverService.getSafeConfigValueFullKey(TERMINAL_SETTING_ID.AutomationShellLinux) as string, - 'terminal.integrated.shell.windows': this._terminalProfileResolverService.getSafeConfigValueFullKey(TERMINAL_SETTING_ID.ShellWindows) as string, - 'terminal.integrated.shell.osx': this._terminalProfileResolverService.getSafeConfigValueFullKey(TERMINAL_SETTING_ID.ShellMacOs) as string, - 'terminal.integrated.shell.linux': this._terminalProfileResolverService.getSafeConfigValueFullKey(TERMINAL_SETTING_ID.ShellLinux) as string, - 'terminal.integrated.shellArgs.windows': this._terminalProfileResolverService.getSafeConfigValueFullKey(TERMINAL_SETTING_ID.ShellArgsWindows) as string | string[], - 'terminal.integrated.shellArgs.osx': this._terminalProfileResolverService.getSafeConfigValueFullKey(TERMINAL_SETTING_ID.ShellArgsMacOs) as string | string[], - 'terminal.integrated.shellArgs.linux': this._terminalProfileResolverService.getSafeConfigValueFullKey(TERMINAL_SETTING_ID.ShellArgsLinux) as string | string[], - 'terminal.integrated.env.windows': this._terminalProfileResolverService.getSafeConfigValueFullKey(TERMINAL_SETTING_ID.EnvWindows) as ITerminalEnvironment, - 'terminal.integrated.env.osx': this._terminalProfileResolverService.getSafeConfigValueFullKey(TERMINAL_SETTING_ID.EnvMacOs) as ITerminalEnvironment, - 'terminal.integrated.env.linux': this._terminalProfileResolverService.getSafeConfigValueFullKey(TERMINAL_SETTING_ID.EnvLinux) as ITerminalEnvironment, - 'terminal.integrated.cwd': this._terminalProfileResolverService.getSafeConfigValueFullKey(TERMINAL_SETTING_ID.Cwd) as string, + 'terminal.integrated.automationShell.windows': this._terminalProfileResolverService.getSafeConfigValueFullKey(TerminalSettingId.AutomationShellWindows) as string, + 'terminal.integrated.automationShell.osx': this._terminalProfileResolverService.getSafeConfigValueFullKey(TerminalSettingId.AutomationShellMacOs) as string, + 'terminal.integrated.automationShell.linux': this._terminalProfileResolverService.getSafeConfigValueFullKey(TerminalSettingId.AutomationShellLinux) as string, + 'terminal.integrated.shell.windows': this._terminalProfileResolverService.getSafeConfigValueFullKey(TerminalSettingId.ShellWindows) as string, + 'terminal.integrated.shell.osx': this._terminalProfileResolverService.getSafeConfigValueFullKey(TerminalSettingId.ShellMacOs) as string, + 'terminal.integrated.shell.linux': this._terminalProfileResolverService.getSafeConfigValueFullKey(TerminalSettingId.ShellLinux) as string, + 'terminal.integrated.shellArgs.windows': this._terminalProfileResolverService.getSafeConfigValueFullKey(TerminalSettingId.ShellArgsWindows) as string | string[], + 'terminal.integrated.shellArgs.osx': this._terminalProfileResolverService.getSafeConfigValueFullKey(TerminalSettingId.ShellArgsMacOs) as string | string[], + 'terminal.integrated.shellArgs.linux': this._terminalProfileResolverService.getSafeConfigValueFullKey(TerminalSettingId.ShellArgsLinux) as string | string[], + 'terminal.integrated.env.windows': this._terminalProfileResolverService.getSafeConfigValueFullKey(TerminalSettingId.EnvWindows) as ITerminalEnvironment, + 'terminal.integrated.env.osx': this._terminalProfileResolverService.getSafeConfigValueFullKey(TerminalSettingId.EnvMacOs) as ITerminalEnvironment, + 'terminal.integrated.env.linux': this._terminalProfileResolverService.getSafeConfigValueFullKey(TerminalSettingId.EnvLinux) as ITerminalEnvironment, + 'terminal.integrated.cwd': this._terminalProfileResolverService.getSafeConfigValueFullKey(TerminalSettingId.Cwd) as string, 'terminal.integrated.detectLocale': terminalConfig.detectLocale }; newProcess = await this._remoteTerminalService.createProcess(shellLaunchConfig, configuration, activeWorkspaceRootUri, cols, rows, shouldPersist, this._configHelper); @@ -288,7 +288,7 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce this._process = newProcess; - this.processState = ProcessState.LAUNCHING; + this.processState = ProcessState.Launching; this._dataFilter.newProcess(this._process, reset); @@ -319,8 +319,8 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce } setTimeout(() => { - if (this.processState === ProcessState.LAUNCHING) { - this.processState = ProcessState.RUNNING; + if (this.processState === ProcessState.Launching) { + this.processState = ProcessState.Running; } }, LAUNCHING_DURATION); @@ -541,14 +541,14 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce // If the process is marked as launching then mark the process as killed // during launch. This typically means that there is a problem with the // shell and args. - if (this.processState === ProcessState.LAUNCHING) { - this.processState = ProcessState.KILLED_DURING_LAUNCH; + if (this.processState === ProcessState.Launching) { + this.processState = ProcessState.KilledDuringLaunch; } // If TerminalInstance did not know about the process exit then it was // triggered by the process, not on VS Code's side. - if (this.processState === ProcessState.RUNNING) { - this.processState = ProcessState.KILLED_BY_PROCESS; + if (this.processState === ProcessState.Running) { + this.processState = ProcessState.KilledByProcess; } this._onProcessExit.fire(exitCode); diff --git a/src/vs/workbench/contrib/terminal/browser/terminalProfileResolverService.ts b/src/vs/workbench/contrib/terminal/browser/terminalProfileResolverService.ts index ace09cd7c44..6edaaabd893 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalProfileResolverService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalProfileResolverService.ts @@ -14,7 +14,7 @@ import { IConfigurationResolverService } from 'vs/workbench/services/configurati import { IHistoryService } from 'vs/workbench/services/history/common/history'; import { IProcessEnvironment, OperatingSystem } from 'vs/base/common/platform'; import { IShellLaunchConfig } from 'vs/platform/terminal/common/terminal'; -import { IShellLaunchConfigResolveOptions, ITerminalProfile, ITerminalProfileResolverService, TERMINAL_SETTING_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { IShellLaunchConfigResolveOptions, ITerminalProfile, ITerminalProfileResolverService, TerminalSettingId } from 'vs/workbench/contrib/terminal/common/terminal'; import * as path from 'vs/base/common/path'; import { Codicon, iconRegistry } from 'vs/base/common/codicons'; @@ -280,7 +280,7 @@ export abstract class BaseTerminalProfileResolverService implements ITerminalPro return this.getSafeConfigValueFullKey(`terminal.integrated.${key}.${this._getOsKey(os)}`); } getSafeConfigValueFullKey(key: string): unknown | undefined { - const isWorkspaceConfigAllowed = this._configurationService.getValue(TERMINAL_SETTING_ID.AllowWorkspaceConfiguration); + const isWorkspaceConfigAllowed = this._configurationService.getValue(TerminalSettingId.AllowWorkspaceConfiguration); if (isWorkspaceConfigAllowed) { return this._configurationService.getValue(key); } else { diff --git a/src/vs/workbench/contrib/terminal/browser/terminalQuickAccess.ts b/src/vs/workbench/contrib/terminal/browser/terminalQuickAccess.ts index 0504f0979dc..49b977ff524 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalQuickAccess.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalQuickAccess.ts @@ -9,7 +9,7 @@ import { IPickerQuickAccessItem, PickerQuickAccessProvider, TriggerAction } from import { matchesFuzzy } from 'vs/base/common/filters'; import { ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal'; import { ICommandService } from 'vs/platform/commands/common/commands'; -import { TERMINAL_COMMAND_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { TerminalCommandId } from 'vs/workbench/contrib/terminal/common/terminal'; import { ThemeIcon } from 'vs/platform/theme/common/themeService'; import { killTerminalIcon, renameTerminalIcon } from 'vs/workbench/contrib/terminal/browser/terminalIcons'; @@ -52,7 +52,7 @@ export class TerminalQuickAccessProvider extends PickerQuickAccessProvider { switch (buttonIndex) { case 0: - this._commandService.executeCommand(TERMINAL_COMMAND_ID.Rename, terminal); + this._commandService.executeCommand(TerminalCommandId.Rename, terminal); return TriggerAction.NO_ACTION; case 1: terminal.dispose(true); @@ -78,13 +78,13 @@ export class TerminalQuickAccessProvider extends PickerQuickAccessProvider this._commandService.executeCommand(TERMINAL_COMMAND_ID.New) + accept: () => this._commandService.executeCommand(TerminalCommandId.New) }); const createWithProfileLabel = localize("workbench.action.terminal.newWithProfilePlus", "Create New Terminal With Profile"); terminalPicks.push({ label: `$(plus) ${createWithProfileLabel}`, ariaLabel: createWithProfileLabel, - accept: () => this._commandService.executeCommand(TERMINAL_COMMAND_ID.NewWithProfile) + accept: () => this._commandService.executeCommand(TerminalCommandId.NewWithProfile) }); return terminalPicks; diff --git a/src/vs/workbench/contrib/terminal/browser/terminalService.ts b/src/vs/workbench/contrib/terminal/browser/terminalService.ts index 947ef726bce..7d3fcfe01da 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalService.ts @@ -25,7 +25,7 @@ import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/browser/term import { TerminalInstance } from 'vs/workbench/contrib/terminal/browser/terminalInstance'; import { TerminalTab } from 'vs/workbench/contrib/terminal/browser/terminalTab'; import { TerminalViewPane } from 'vs/workbench/contrib/terminal/browser/terminalView'; -import { IAvailableProfilesRequest, IRemoteTerminalAttachTarget, ITerminalProfile, IStartExtensionTerminalRequest, ITerminalConfigHelper, ITerminalProcessExtHostProxy, KEYBINDING_CONTEXT_TERMINAL_ALT_BUFFER_ACTIVE, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_IS_OPEN, KEYBINDING_CONTEXT_TERMINAL_PROCESS_SUPPORTED, KEYBINDING_CONTEXT_TERMINAL_SHELL_TYPE, TERMINAL_VIEW_ID, ITerminalProfileObject, ITerminalTypeContribution, KEYBINDING_CONTEXT_TERMINAL_COUNT, TERMINAL_SETTING_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { IAvailableProfilesRequest, IRemoteTerminalAttachTarget, ITerminalProfile, IStartExtensionTerminalRequest, ITerminalConfigHelper, ITerminalProcessExtHostProxy, KEYBINDING_CONTEXT_TERMINAL_ALT_BUFFER_ACTIVE, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_IS_OPEN, KEYBINDING_CONTEXT_TERMINAL_PROCESS_SUPPORTED, KEYBINDING_CONTEXT_TERMINAL_SHELL_TYPE, TERMINAL_VIEW_ID, ITerminalProfileObject, ITerminalTypeContribution, KEYBINDING_CONTEXT_TERMINAL_COUNT, TerminalSettingId } from 'vs/workbench/contrib/terminal/common/terminal'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; @@ -173,13 +173,13 @@ export class TerminalService implements ITerminalService { this._processSupportContextKey.set(!isWeb || this._remoteAgentService.getConnection() !== null); this._configurationService.onDidChangeConfiguration(async e => { - if (e.affectsConfiguration(TERMINAL_SETTING_ID.ProfilesWindows) || - e.affectsConfiguration(TERMINAL_SETTING_ID.ProfilesMacOs) || - e.affectsConfiguration(TERMINAL_SETTING_ID.ProfilesLinux) || - e.affectsConfiguration(TERMINAL_SETTING_ID.DefaultProfileWindows) || - e.affectsConfiguration(TERMINAL_SETTING_ID.DefaultProfileMacOs) || - e.affectsConfiguration(TERMINAL_SETTING_ID.DefaultProfileLinux) || - e.affectsConfiguration(TERMINAL_SETTING_ID.UseWslProfiles)) { + if (e.affectsConfiguration(TerminalSettingId.ProfilesWindows) || + e.affectsConfiguration(TerminalSettingId.ProfilesMacOs) || + e.affectsConfiguration(TerminalSettingId.ProfilesLinux) || + e.affectsConfiguration(TerminalSettingId.DefaultProfileWindows) || + e.affectsConfiguration(TerminalSettingId.DefaultProfileMacOs) || + e.affectsConfiguration(TerminalSettingId.DefaultProfileLinux) || + e.affectsConfiguration(TerminalSettingId.UseWslProfiles)) { this._refreshAvailableProfiles(); } }); @@ -705,7 +705,7 @@ export class TerminalService implements ITerminalService { } public showTabs() { - this._configurationService.updateValue(TERMINAL_SETTING_ID.TabsEnabled, true); + this._configurationService.updateValue(TerminalSettingId.TabsEnabled, true); } private _getIndexFromId(terminalId: number): number { diff --git a/src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts b/src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts index 7cbc2006215..31d2f3904cd 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts @@ -23,7 +23,7 @@ import { Action, IAction, Separator } from 'vs/base/common/actions'; import { IMenu, IMenuService, MenuId } from 'vs/platform/actions/common/actions'; import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { KEYBINDING_CONTEXT_TERMINAL_FIND_VISIBLE, KEYBINDING_CONTEXT_TERMINAL_IS_TABS_NARROW_FOCUS, KEYBINDING_CONTEXT_TERMINAL_TABS_FOCUS, TERMINAL_SETTING_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { KEYBINDING_CONTEXT_TERMINAL_FIND_VISIBLE, KEYBINDING_CONTEXT_TERMINAL_IS_TABS_NARROW_FOCUS, KEYBINDING_CONTEXT_TERMINAL_TABS_FOCUS, TerminalSettingId } from 'vs/workbench/contrib/terminal/common/terminal'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { ILogService } from 'vs/platform/log/common/log'; import { localize } from 'vs/nls'; @@ -113,10 +113,10 @@ export class TerminalTabbedView extends Disposable { this._terminalTabsFocusContextKey = KEYBINDING_CONTEXT_TERMINAL_TABS_FOCUS.bindTo(contextKeyService); _configurationService.onDidChangeConfiguration(e => { - if (e.affectsConfiguration(TERMINAL_SETTING_ID.TabsEnabled) || - e.affectsConfiguration(TERMINAL_SETTING_ID.TabsHideCondition)) { + if (e.affectsConfiguration(TerminalSettingId.TabsEnabled) || + e.affectsConfiguration(TerminalSettingId.TabsHideCondition)) { this._refreshShowTabs(); - } else if (e.affectsConfiguration(TERMINAL_SETTING_ID.TabsLocation)) { + } else if (e.affectsConfiguration(TerminalSettingId.TabsLocation)) { this._tabTreeIndex = this._terminalService.configHelper.config.tabs.location === 'left' ? 0 : 1; this._terminalContainerIndex = this._terminalService.configHelper.config.tabs.location === 'left' ? 1 : 0; if (this._shouldShowTabs()) { @@ -460,15 +460,15 @@ export class TerminalTabbedView extends Disposable { private _getTabActions(): Action[] { return [ new Separator(), - this._configurationService.inspect(TERMINAL_SETTING_ID.TabsLocation).userValue === 'left' ? + this._configurationService.inspect(TerminalSettingId.TabsLocation).userValue === 'left' ? new Action('moveRight', localize('moveTabsRight', "Move Tabs Right"), undefined, undefined, async () => { - this._configurationService.updateValue(TERMINAL_SETTING_ID.TabsLocation, 'right'); + this._configurationService.updateValue(TerminalSettingId.TabsLocation, 'right'); }) : new Action('moveLeft', localize('moveTabsLeft', "Move Tabs Left"), undefined, undefined, async () => { - this._configurationService.updateValue(TERMINAL_SETTING_ID.TabsLocation, 'left'); + this._configurationService.updateValue(TerminalSettingId.TabsLocation, 'left'); }), new Action('hideTabs', localize('hideTabs', "Hide Tabs"), undefined, undefined, async () => { - this._configurationService.updateValue(TERMINAL_SETTING_ID.TabsEnabled, false); + this._configurationService.updateValue(TerminalSettingId.TabsEnabled, false); }) ]; } diff --git a/src/vs/workbench/contrib/terminal/browser/terminalTabsWidget.ts b/src/vs/workbench/contrib/terminal/browser/terminalTabsWidget.ts index e9c01e6ef78..84b95d3e2f0 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalTabsWidget.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalTabsWidget.ts @@ -18,7 +18,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { MenuItemAction } from 'vs/platform/actions/common/actions'; import { MenuEntryActionViewItem } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { KEYBINDING_CONTEXT_TERMINAL_TABS_SINGULAR_SELECTION, TERMINAL_COMMAND_ID, TERMINAL_SETTING_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { KEYBINDING_CONTEXT_TERMINAL_TABS_SINGULAR_SELECTION, TerminalCommandId, TerminalSettingId } from 'vs/workbench/contrib/terminal/common/terminal'; import { Codicon } from 'vs/base/common/codicons'; import { Action } from 'vs/base/common/actions'; import { MarkdownString } from 'vs/base/common/htmlContent'; @@ -98,7 +98,7 @@ export class TerminalTabsWidget extends WorkbenchObjectTree this.onMouseClick(e => { // If focus mode is single click focus the element unless a multi-select in happening - const focusMode = configurationService.getValue<'singleClick' | 'doubleClick'>(TERMINAL_SETTING_ID.TabsFocusMode); + const focusMode = configurationService.getValue<'singleClick' | 'doubleClick'>(TerminalSettingId.TabsFocusMode); if (focusMode === 'singleClick') { if (this.getSelection().length <= 1) { e.element?.focus(true); @@ -312,10 +312,10 @@ class TerminalTabsRenderer implements ITreeRenderer { + new Action(TerminalCommandId.SplitInstance, localize('terminal.split', "Split"), ThemeIcon.asClassName(Codicon.splitHorizontal), true, async () => { this._runForSelectionOrInstance(instance, e => this._terminalService.splitInstance(e)); }), - new Action(TERMINAL_COMMAND_ID.KillInstance, localize('terminal.kill', "Kill"), ThemeIcon.asClassName(Codicon.trashcan), true, async () => { + new Action(TerminalCommandId.KillInstance, localize('terminal.kill', "Kill"), ThemeIcon.asClassName(Codicon.trashcan), true, async () => { this._runForSelectionOrInstance(instance, e => e.dispose()); }) ]; diff --git a/src/vs/workbench/contrib/terminal/browser/terminalView.ts b/src/vs/workbench/contrib/terminal/browser/terminalView.ts index 8adbd9df560..1f2af75a647 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalView.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalView.ts @@ -21,7 +21,7 @@ import { IViewDescriptorService } from 'vs/workbench/common/views'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { PANEL_BACKGROUND, SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme'; import { IMenu, IMenuService, MenuId, MenuItemAction } from 'vs/platform/actions/common/actions'; -import { ITerminalProfile, TERMINAL_COMMAND_ID, TERMINAL_SETTING_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { ITerminalProfile, TerminalCommandId, TerminalSettingId } from 'vs/workbench/contrib/terminal/common/terminal'; import { ActionViewItem, SelectActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems'; import { ITerminalContributionService } from 'vs/workbench/contrib/terminal/common/terminalExtensionPoints'; import { attachSelectBoxStyler, attachStylerCallback } from 'vs/platform/theme/common/styler'; @@ -109,12 +109,12 @@ export class TerminalViewPane extends ViewPane { this._parentDomElement.appendChild(this._fontStyleElement); this._register(this.configurationService.onDidChangeConfiguration(e => { - if (e.affectsConfiguration(TERMINAL_SETTING_ID.FontFamily) || e.affectsConfiguration('editor.fontFamily')) { + if (e.affectsConfiguration(TerminalSettingId.FontFamily) || e.affectsConfiguration('editor.fontFamily')) { const configHelper = this._terminalService.configHelper; if (!configHelper.configFontIsMonospace()) { const choices: IPromptChoice[] = [{ label: nls.localize('terminal.useMonospace', "Use 'monospace'"), - run: () => this.configurationService.updateValue(TERMINAL_SETTING_ID.FontFamily, 'monospace'), + run: () => this.configurationService.updateValue(TerminalSettingId.FontFamily, 'monospace'), }]; this._notificationService.prompt(Severity.Warning, nls.localize('terminal.monospaceOnly', "The terminal only supports monospace fonts. Be sure to restart VS Code if this is a newly installed font."), choices); } @@ -173,15 +173,15 @@ export class TerminalViewPane extends ViewPane { public override getActionViewItem(action: Action): IActionViewItem | undefined { switch (action.id) { - case TERMINAL_COMMAND_ID.SwitchTerminal: { + case TerminalCommandId.SwitchTerminal: { return this._instantiationService.createInstance(SwitchTerminalActionViewItem, action); } - case TERMINAL_COMMAND_ID.Focus: { + case TerminalCommandId.Focus: { const actions: IAction[] = []; createAndFillInContextMenuActions(this._singleTabMenu, undefined, actions); return this._instantiationService.createInstance(SingleTerminalTabActionViewItem, action, actions); } - case TERMINAL_COMMAND_ID.CreateWithProfileButton: { + case TerminalCommandId.CreateWithProfileButton: { if (this._tabButtons) { this._tabButtons.dispose(); } @@ -210,8 +210,8 @@ export class TerminalViewPane extends ViewPane { const submenuActions: IAction[] = []; for (const p of profiles) { - dropdownActions.push(new MenuItemAction({ id: TERMINAL_COMMAND_ID.NewWithProfile, title: p.profileName, category: TerminalTabContextMenuGroup.Profile }, undefined, { arg: p, shouldForwardArgs: true }, this._contextKeyService, this._commandService)); - submenuActions.push(new MenuItemAction({ id: TERMINAL_COMMAND_ID.Split, title: p.profileName, category: TerminalTabContextMenuGroup.Profile }, undefined, { arg: p, shouldForwardArgs: true }, this._contextKeyService, this._commandService)); + dropdownActions.push(new MenuItemAction({ id: TerminalCommandId.NewWithProfile, title: p.profileName, category: TerminalTabContextMenuGroup.Profile }, undefined, { arg: p, shouldForwardArgs: true }, this._contextKeyService, this._commandService)); + submenuActions.push(new MenuItemAction({ id: TerminalCommandId.Split, title: p.profileName, category: TerminalTabContextMenuGroup.Profile }, undefined, { arg: p, shouldForwardArgs: true }, this._contextKeyService, this._commandService)); } for (const contributed of this._terminalContributionService.terminalTypes) { @@ -232,7 +232,7 @@ export class TerminalViewPane extends ViewPane { } } - const primaryAction = this._instantiationService.createInstance(MenuItemAction, { id: TERMINAL_COMMAND_ID.New, title: nls.localize('terminal.new', "New Terminal"), icon: Codicon.plus }, undefined, undefined); + const primaryAction = this._instantiationService.createInstance(MenuItemAction, { id: TerminalCommandId.New, title: nls.localize('terminal.new', "New Terminal"), icon: Codicon.plus }, undefined, undefined); const dropdownAction = new Action('refresh profiles', 'Launch Profile...', 'codicon-chevron-down', true); return { primaryAction, dropdownAction, dropdownMenuActions: dropdownActions, className: 'terminal-tab-actions' }; } diff --git a/src/vs/workbench/contrib/terminal/common/terminal.ts b/src/vs/workbench/contrib/terminal/common/terminal.ts index 5f0aaaeff9c..5096d74604e 100644 --- a/src/vs/workbench/contrib/terminal/common/terminal.ts +++ b/src/vs/workbench/contrib/terminal/common/terminal.ts @@ -343,21 +343,21 @@ export interface ITerminalProcessManager extends IDisposable { export const enum ProcessState { // The process has not been initialized yet. - UNINITIALIZED, + Uninitialized, // The process is currently launching, the process is marked as launching // for a short duration after being created and is helpful to indicate // whether the process died as a result of bad shell and args. - LAUNCHING, + Launching, // The process is running normally. - RUNNING, + Running, // The process was killed during launch, likely as a result of bad shell and // args. - KILLED_DURING_LAUNCH, + KilledDuringLaunch, // The process was killed by the user (the event originated from VS Code). - KILLED_BY_USER, + KilledByUser, // The process was killed by itself, for example the shell crashed or `exit` // was run. - KILLED_BY_PROCESS + KilledByProcess } export interface ITerminalProcessExtHostProxy extends IDisposable { @@ -406,7 +406,7 @@ export enum TitleEventSource { export const QUICK_LAUNCH_PROFILE_CHOICE = 'workbench.action.terminal.profile.choice'; -export const enum TERMINAL_SETTING_ID { +export const enum TerminalSettingId { ShellLinux = 'terminal.integrated.shell.linux', ShellMacOs = 'terminal.integrated.shell.osx', ShellWindows = 'terminal.integrated.shell.windows', @@ -477,7 +477,7 @@ export const enum TERMINAL_SETTING_ID { AllowWorkspaceConfiguration = 'terminal.integrated.allowWorkspaceConfiguration' } -export const enum TERMINAL_COMMAND_ID { +export const enum TerminalCommandId { FindNext = 'workbench.action.terminal.findNext', FindPrevious = 'workbench.action.terminal.findPrevious', Toggle = 'workbench.action.terminal.toggleTerminal', @@ -555,57 +555,57 @@ export const enum TERMINAL_COMMAND_ID { } export const DEFAULT_COMMANDS_TO_SKIP_SHELL: string[] = [ - TERMINAL_COMMAND_ID.ClearSelection, - TERMINAL_COMMAND_ID.Clear, - TERMINAL_COMMAND_ID.CopySelection, - TERMINAL_COMMAND_ID.DeleteToLineStart, - TERMINAL_COMMAND_ID.DeleteWordLeft, - TERMINAL_COMMAND_ID.DeleteWordRight, - TERMINAL_COMMAND_ID.FindFocus, - TERMINAL_COMMAND_ID.FindHide, - TERMINAL_COMMAND_ID.FindNext, - TERMINAL_COMMAND_ID.FindPrevious, - TERMINAL_COMMAND_ID.ToggleFindRegex, - TERMINAL_COMMAND_ID.ToggleFindWholeWord, - TERMINAL_COMMAND_ID.ToggleFindCaseSensitive, - TERMINAL_COMMAND_ID.FocusNextPane, - TERMINAL_COMMAND_ID.FocusNext, - TERMINAL_COMMAND_ID.FocusPreviousPane, - TERMINAL_COMMAND_ID.FocusPrevious, - TERMINAL_COMMAND_ID.Focus, - TERMINAL_COMMAND_ID.Kill, - TERMINAL_COMMAND_ID.MoveToLineEnd, - TERMINAL_COMMAND_ID.MoveToLineStart, - TERMINAL_COMMAND_ID.NewInActiveWorkspace, - TERMINAL_COMMAND_ID.New, - TERMINAL_COMMAND_ID.Paste, - TERMINAL_COMMAND_ID.PasteSelection, - TERMINAL_COMMAND_ID.ResizePaneDown, - TERMINAL_COMMAND_ID.ResizePaneLeft, - TERMINAL_COMMAND_ID.ResizePaneRight, - TERMINAL_COMMAND_ID.ResizePaneUp, - TERMINAL_COMMAND_ID.RunActiveFile, - TERMINAL_COMMAND_ID.RunSelectedText, - TERMINAL_COMMAND_ID.ScrollDownLine, - TERMINAL_COMMAND_ID.ScrollDownPage, - TERMINAL_COMMAND_ID.ScrollToBottom, - TERMINAL_COMMAND_ID.ScrollToNextCommand, - TERMINAL_COMMAND_ID.ScrollToPreviousCommand, - TERMINAL_COMMAND_ID.ScrollToTop, - TERMINAL_COMMAND_ID.ScrollUpLine, - TERMINAL_COMMAND_ID.ScrollUpPage, - TERMINAL_COMMAND_ID.SendSequence, - TERMINAL_COMMAND_ID.SelectAll, - TERMINAL_COMMAND_ID.SelectToNextCommand, - TERMINAL_COMMAND_ID.SelectToNextLine, - TERMINAL_COMMAND_ID.SelectToPreviousCommand, - TERMINAL_COMMAND_ID.SelectToPreviousLine, - TERMINAL_COMMAND_ID.SplitInActiveWorkspace, - TERMINAL_COMMAND_ID.Split, - TERMINAL_COMMAND_ID.Toggle, - TERMINAL_COMMAND_ID.NavigationModeExit, - TERMINAL_COMMAND_ID.NavigationModeFocusNext, - TERMINAL_COMMAND_ID.NavigationModeFocusPrevious, + TerminalCommandId.ClearSelection, + TerminalCommandId.Clear, + TerminalCommandId.CopySelection, + TerminalCommandId.DeleteToLineStart, + TerminalCommandId.DeleteWordLeft, + TerminalCommandId.DeleteWordRight, + TerminalCommandId.FindFocus, + TerminalCommandId.FindHide, + TerminalCommandId.FindNext, + TerminalCommandId.FindPrevious, + TerminalCommandId.ToggleFindRegex, + TerminalCommandId.ToggleFindWholeWord, + TerminalCommandId.ToggleFindCaseSensitive, + TerminalCommandId.FocusNextPane, + TerminalCommandId.FocusNext, + TerminalCommandId.FocusPreviousPane, + TerminalCommandId.FocusPrevious, + TerminalCommandId.Focus, + TerminalCommandId.Kill, + TerminalCommandId.MoveToLineEnd, + TerminalCommandId.MoveToLineStart, + TerminalCommandId.NewInActiveWorkspace, + TerminalCommandId.New, + TerminalCommandId.Paste, + TerminalCommandId.PasteSelection, + TerminalCommandId.ResizePaneDown, + TerminalCommandId.ResizePaneLeft, + TerminalCommandId.ResizePaneRight, + TerminalCommandId.ResizePaneUp, + TerminalCommandId.RunActiveFile, + TerminalCommandId.RunSelectedText, + TerminalCommandId.ScrollDownLine, + TerminalCommandId.ScrollDownPage, + TerminalCommandId.ScrollToBottom, + TerminalCommandId.ScrollToNextCommand, + TerminalCommandId.ScrollToPreviousCommand, + TerminalCommandId.ScrollToTop, + TerminalCommandId.ScrollUpLine, + TerminalCommandId.ScrollUpPage, + TerminalCommandId.SendSequence, + TerminalCommandId.SelectAll, + TerminalCommandId.SelectToNextCommand, + TerminalCommandId.SelectToNextLine, + TerminalCommandId.SelectToPreviousCommand, + TerminalCommandId.SelectToPreviousLine, + TerminalCommandId.SplitInActiveWorkspace, + TerminalCommandId.Split, + TerminalCommandId.Toggle, + TerminalCommandId.NavigationModeExit, + TerminalCommandId.NavigationModeFocusNext, + TerminalCommandId.NavigationModeFocusPrevious, 'editor.action.toggleTabFocusMode', 'workbench.action.quickOpen', 'workbench.action.quickOpenPreviousEditor', diff --git a/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts b/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts index 1a5d45b9788..1874578ab9d 100644 --- a/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts +++ b/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts @@ -6,7 +6,7 @@ import { ConfigurationScope, IConfigurationNode } from 'vs/platform/configuration/common/configurationRegistry'; import { localize } from 'vs/nls'; import { EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions'; -import { DEFAULT_LETTER_SPACING, DEFAULT_LINE_HEIGHT, TerminalCursorStyle, DEFAULT_COMMANDS_TO_SKIP_SHELL, SUGGESTIONS_FONT_WEIGHT, MINIMUM_FONT_WEIGHT, MAXIMUM_FONT_WEIGHT, DEFAULT_LOCAL_ECHO_EXCLUDE, TERMINAL_SETTING_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { DEFAULT_LETTER_SPACING, DEFAULT_LINE_HEIGHT, TerminalCursorStyle, DEFAULT_COMMANDS_TO_SKIP_SHELL, SUGGESTIONS_FONT_WEIGHT, MINIMUM_FONT_WEIGHT, MAXIMUM_FONT_WEIGHT, DEFAULT_LOCAL_ECHO_EXCLUDE, TerminalSettingId } from 'vs/workbench/contrib/terminal/common/terminal'; import { isMacintosh, isWindows } from 'vs/base/common/platform'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; @@ -53,12 +53,12 @@ export const terminalConfiguration: IConfigurationNode = { title: localize('terminalIntegratedConfigurationTitle', "Integrated Terminal"), type: 'object', properties: { - [TERMINAL_SETTING_ID.SendKeybindingsToShell]: { + [TerminalSettingId.SendKeybindingsToShell]: { markdownDescription: localize('terminal.integrated.sendKeybindingsToShell', "Dispatches most keybindings to the terminal instead of the workbench, overriding `#terminal.integrated.commandsToSkipShell#`, which can be used alternatively for fine tuning."), type: 'boolean', default: false }, - [TERMINAL_SETTING_ID.AutomationShellLinux]: { + [TerminalSettingId.AutomationShellLinux]: { restricted: true, markdownDescription: localize({ key: 'terminal.integrated.automationShell.linux', @@ -67,7 +67,7 @@ export const terminalConfiguration: IConfigurationNode = { type: ['string', 'null'], default: null }, - [TERMINAL_SETTING_ID.AutomationShellMacOs]: { + [TerminalSettingId.AutomationShellMacOs]: { restricted: true, markdownDescription: localize({ key: 'terminal.integrated.automationShell.osx', @@ -76,7 +76,7 @@ export const terminalConfiguration: IConfigurationNode = { type: ['string', 'null'], default: null }, - [TERMINAL_SETTING_ID.AutomationShellWindows]: { + [TerminalSettingId.AutomationShellWindows]: { restricted: true, markdownDescription: localize({ key: 'terminal.integrated.automationShell.windows', @@ -85,28 +85,28 @@ export const terminalConfiguration: IConfigurationNode = { type: ['string', 'null'], default: null }, - [TERMINAL_SETTING_ID.ShellLinux]: { + [TerminalSettingId.ShellLinux]: { restricted: true, markdownDescription: localize('terminal.integrated.shell.linux', "The path of the shell that the terminal uses on Linux. [Read more about configuring the shell](https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration)."), type: ['string', 'null'], default: null, markdownDeprecationMessage: 'This is deprecated, use `#terminal.integrated.defaultProfile.linux#` instead' }, - [TERMINAL_SETTING_ID.ShellMacOs]: { + [TerminalSettingId.ShellMacOs]: { restricted: true, markdownDescription: localize('terminal.integrated.shell.osx', "The path of the shell that the terminal uses on macOS. [Read more about configuring the shell](https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration)."), type: ['string', 'null'], default: null, markdownDeprecationMessage: 'This is deprecated, use `#terminal.integrated.defaultProfile.osx#` instead' }, - [TERMINAL_SETTING_ID.ShellWindows]: { + [TerminalSettingId.ShellWindows]: { restricted: true, markdownDescription: localize('terminal.integrated.shell.windows', "The path of the shell that the terminal uses on Windows. [Read more about configuring the shell](https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration)."), type: ['string', 'null'], default: null, markdownDeprecationMessage: 'This is deprecated, use `#terminal.integrated.defaultProfile.windows#` instead' }, - [TERMINAL_SETTING_ID.ShellArgsLinux]: { + [TerminalSettingId.ShellArgsLinux]: { restricted: true, markdownDescription: localize('terminal.integrated.shellArgs.linux', "The command line arguments to use when on the Linux terminal. [Read more about configuring the shell](https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration)."), type: 'array', @@ -116,7 +116,7 @@ export const terminalConfiguration: IConfigurationNode = { default: [], markdownDeprecationMessage: 'This is deprecated, use `#terminal.integrated.defaultProfile.linux#` instead' }, - [TERMINAL_SETTING_ID.ShellArgsMacOs]: { + [TerminalSettingId.ShellArgsMacOs]: { restricted: true, markdownDescription: localize('terminal.integrated.shellArgs.osx', "The command line arguments to use when on the macOS terminal. [Read more about configuring the shell](https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration)."), type: 'array', @@ -129,7 +129,7 @@ export const terminalConfiguration: IConfigurationNode = { default: ['-l'], markdownDeprecationMessage: 'This is deprecated, use `#terminal.integrated.defaultProfile.osx#` instead' }, - [TERMINAL_SETTING_ID.ShellArgsWindows]: { + [TerminalSettingId.ShellArgsWindows]: { restricted: true, markdownDescription: localize('terminal.integrated.shellArgs.windows', "The command line arguments to use when on the Windows terminal. [Read more about configuring the shell](https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration)."), 'anyOf': [ @@ -148,7 +148,7 @@ export const terminalConfiguration: IConfigurationNode = { default: [], markdownDeprecationMessage: 'This is deprecated, use `#terminal.integrated.defaultProfile.windows#` instead' }, - [TERMINAL_SETTING_ID.ProfilesWindows]: { + [TerminalSettingId.ProfilesWindows]: { restricted: true, markdownDescription: localize( { @@ -208,7 +208,7 @@ export const terminalConfiguration: IConfigurationNode = { ] } }, - [TERMINAL_SETTING_ID.ProfilesMacOs]: { + [TerminalSettingId.ProfilesMacOs]: { restricted: true, markdownDescription: localize( { @@ -245,7 +245,7 @@ export const terminalConfiguration: IConfigurationNode = { ] } }, - [TERMINAL_SETTING_ID.ProfilesLinux]: { + [TerminalSettingId.ProfilesLinux]: { restricted: true, markdownDescription: localize( { @@ -281,35 +281,35 @@ export const terminalConfiguration: IConfigurationNode = { ] } }, - [TERMINAL_SETTING_ID.DefaultProfileLinux]: { + [TerminalSettingId.DefaultProfileLinux]: { description: localize('terminal.integrated.defaultProfile.linux', 'The default profile used on Linux. When set to a valid profile name, this will override the values of `terminal.integrated.shell.osx` and `terminal.integrated.shellArgs.osx`.'), type: ['string', 'null'], default: null, scope: ConfigurationScope.APPLICATION // Disallow setting the default in workspace settings }, - [TERMINAL_SETTING_ID.DefaultProfileMacOs]: { + [TerminalSettingId.DefaultProfileMacOs]: { description: localize('terminal.integrated.defaultProfile.osx', 'The default profile used on macOS. When set to a valid profile name, this will override the values of `terminal.integrated.shell.osx` and `terminal.integrated.shellArgs.osx`.'), type: ['string', 'null'], default: null, scope: ConfigurationScope.APPLICATION // Disallow setting the default in workspace settings }, - [TERMINAL_SETTING_ID.DefaultProfileWindows]: { + [TerminalSettingId.DefaultProfileWindows]: { description: localize('terminal.integrated.defaultProfile.windows', 'The default profile used on Windows. When set to a valid profile name, this will override the values of `terminal.integrated.shell.windows` and `terminal.integrated.shellArgs.windows`.'), type: ['string', 'null'], default: null, scope: ConfigurationScope.APPLICATION // Disallow setting the default in workspace settings }, - [TERMINAL_SETTING_ID.UseWslProfiles]: { + [TerminalSettingId.UseWslProfiles]: { description: localize('terminal.integrated.useWslProfiles', 'Controls whether or not WSL distros are shown in the terminal dropdown'), type: 'boolean', default: true }, - [TERMINAL_SETTING_ID.TabsEnabled]: { + [TerminalSettingId.TabsEnabled]: { description: localize('terminal.integrated.tabs.enabled', 'Controls whether terminal tabs display as a list to the side of the terminal. When this is disabled a dropdown will display instead.'), type: 'boolean', default: true, }, - [TERMINAL_SETTING_ID.TabsHideCondition]: { + [TerminalSettingId.TabsHideCondition]: { description: localize('terminal.integrated.tabs.hideCondition', 'Controls whether the terminal tabs view will hide under certain conditions.'), type: 'string', enum: ['never', 'singleTerminal'], @@ -319,7 +319,7 @@ export const terminalConfiguration: IConfigurationNode = { ], default: 'singleTerminal', }, - [TERMINAL_SETTING_ID.TabsShowActiveTerminal]: { + [TerminalSettingId.TabsShowActiveTerminal]: { description: localize('terminal.integrated.tabs.showActiveTerminal', 'Shows the active terminal information in the view, this is particularly useful when the title within the tabs aren\'t visible.'), type: 'string', enum: ['always', 'singleTerminal', 'singleTerminalOrNarrow', 'never'], @@ -331,7 +331,7 @@ export const terminalConfiguration: IConfigurationNode = { ], default: 'singleTerminalOrNarrow', }, - [TERMINAL_SETTING_ID.TabsLocation]: { + [TerminalSettingId.TabsLocation]: { type: 'string', enum: ['left', 'right'], enumDescriptions: [ @@ -341,7 +341,7 @@ export const terminalConfiguration: IConfigurationNode = { default: 'right', description: localize('terminal.integrated.tabs.location', "Controls the location of the terminal tabs, either to the left or right of the actual terminal(s).") }, - [TERMINAL_SETTING_ID.TabsFocusMode]: { + [TerminalSettingId.TabsFocusMode]: { type: 'string', enum: ['singleClick', 'doubleClick'], enumDescriptions: [ @@ -351,32 +351,32 @@ export const terminalConfiguration: IConfigurationNode = { default: 'doubleClick', description: localize('terminal.integrated.tabs.focusMode', "Controls whether focusing the terminal of a tab happens on double or single click.") }, - [TERMINAL_SETTING_ID.MacOptionIsMeta]: { + [TerminalSettingId.MacOptionIsMeta]: { description: localize('terminal.integrated.macOptionIsMeta', "Controls whether to treat the option key as the meta key in the terminal on macOS."), type: 'boolean', default: false }, - [TERMINAL_SETTING_ID.MacOptionClickForcesSelection]: { + [TerminalSettingId.MacOptionClickForcesSelection]: { description: localize('terminal.integrated.macOptionClickForcesSelection', "Controls whether to force selection when using Option+click on macOS. This will force a regular (line) selection and disallow the use of column selection mode. This enables copying and pasting using the regular terminal selection, for example, when mouse mode is enabled in tmux."), type: 'boolean', default: false }, - [TERMINAL_SETTING_ID.AltClickMovesCursor]: { + [TerminalSettingId.AltClickMovesCursor]: { markdownDescription: localize('terminal.integrated.altClickMovesCursor', "If enabled, alt/option + click will reposition the prompt cursor to underneath the mouse when `#editor.multiCursorModifier#` is set to `'alt'` (the default value). This may not work reliably depending on your shell."), type: 'boolean', default: true }, - [TERMINAL_SETTING_ID.CopyOnSelection]: { + [TerminalSettingId.CopyOnSelection]: { description: localize('terminal.integrated.copyOnSelection', "Controls whether text selected in the terminal will be copied to the clipboard."), type: 'boolean', default: false }, - [TERMINAL_SETTING_ID.DrawBoldTextInBrightColors]: { + [TerminalSettingId.DrawBoldTextInBrightColors]: { description: localize('terminal.integrated.drawBoldTextInBrightColors', "Controls whether bold text in the terminal will always use the \"bright\" ANSI color variant."), type: 'boolean', default: true }, - [TERMINAL_SETTING_ID.FontFamily]: { + [TerminalSettingId.FontFamily]: { markdownDescription: localize('terminal.integrated.fontFamily', "Controls the font family of the terminal, this defaults to `#editor.fontFamily#`'s value."), type: 'string' }, @@ -386,42 +386,42 @@ export const terminalConfiguration: IConfigurationNode = { // 'type': 'boolean', // 'default': false // }, - [TERMINAL_SETTING_ID.FontSize]: { + [TerminalSettingId.FontSize]: { description: localize('terminal.integrated.fontSize', "Controls the font size in pixels of the terminal."), type: 'number', default: EDITOR_FONT_DEFAULTS.fontSize }, - [TERMINAL_SETTING_ID.LetterSpacing]: { + [TerminalSettingId.LetterSpacing]: { description: localize('terminal.integrated.letterSpacing', "Controls the letter spacing of the terminal, this is an integer value which represents the amount of additional pixels to add between characters."), type: 'number', default: DEFAULT_LETTER_SPACING }, - [TERMINAL_SETTING_ID.LineHeight]: { + [TerminalSettingId.LineHeight]: { description: localize('terminal.integrated.lineHeight', "Controls the line height of the terminal, this number is multiplied by the terminal font size to get the actual line-height in pixels."), type: 'number', default: DEFAULT_LINE_HEIGHT }, - [TERMINAL_SETTING_ID.MinimumContrastRatio]: { + [TerminalSettingId.MinimumContrastRatio]: { markdownDescription: localize('terminal.integrated.minimumContrastRatio', "When set the foreground color of each cell will change to try meet the contrast ratio specified. Example values:\n\n- 1: The default, do nothing.\n- 4.5: [WCAG AA compliance (minimum)](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html).\n- 7: [WCAG AAA compliance (enhanced)](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast7.html).\n- 21: White on black or black on white."), type: 'number', default: 1 }, - [TERMINAL_SETTING_ID.FastScrollSensitivity]: { + [TerminalSettingId.FastScrollSensitivity]: { markdownDescription: localize('terminal.integrated.fastScrollSensitivity', "Scrolling speed multiplier when pressing `Alt`."), type: 'number', default: 5 }, - [TERMINAL_SETTING_ID.MouseWheelScrollSensitivity]: { + [TerminalSettingId.MouseWheelScrollSensitivity]: { markdownDescription: localize('terminal.integrated.mouseWheelScrollSensitivity', "A multiplier to be used on the `deltaY` of mouse wheel scroll events."), type: 'number', default: 1 }, - [TERMINAL_SETTING_ID.BellDuration]: { + [TerminalSettingId.BellDuration]: { markdownDescription: localize('terminal.integrated.bellDuration', "The number of milliseconds to show the bell within a terminal tab when triggered."), type: 'number', default: 1000 }, - [TERMINAL_SETTING_ID.FontWeight]: { + [TerminalSettingId.FontWeight]: { 'anyOf': [ { type: 'number', @@ -440,7 +440,7 @@ export const terminalConfiguration: IConfigurationNode = { description: localize('terminal.integrated.fontWeight', "The font weight to use within the terminal for non-bold text. Accepts \"normal\" and \"bold\" keywords or numbers between 1 and 1000."), default: 'normal' }, - [TERMINAL_SETTING_ID.FontWeightBold]: { + [TerminalSettingId.FontWeightBold]: { 'anyOf': [ { type: 'number', @@ -459,27 +459,27 @@ export const terminalConfiguration: IConfigurationNode = { description: localize('terminal.integrated.fontWeightBold', "The font weight to use within the terminal for bold text. Accepts \"normal\" and \"bold\" keywords or numbers between 1 and 1000."), default: 'bold' }, - [TERMINAL_SETTING_ID.CursorBlinking]: { + [TerminalSettingId.CursorBlinking]: { description: localize('terminal.integrated.cursorBlinking', "Controls whether the terminal cursor blinks."), type: 'boolean', default: false }, - [TERMINAL_SETTING_ID.CursorStyle]: { + [TerminalSettingId.CursorStyle]: { description: localize('terminal.integrated.cursorStyle', "Controls the style of terminal cursor."), enum: [TerminalCursorStyle.BLOCK, TerminalCursorStyle.LINE, TerminalCursorStyle.UNDERLINE], default: TerminalCursorStyle.BLOCK }, - [TERMINAL_SETTING_ID.CursorWidth]: { + [TerminalSettingId.CursorWidth]: { markdownDescription: localize('terminal.integrated.cursorWidth', "Controls the width of the cursor when `#terminal.integrated.cursorStyle#` is set to `line`."), type: 'number', default: 1 }, - [TERMINAL_SETTING_ID.Scrollback]: { + [TerminalSettingId.Scrollback]: { description: localize('terminal.integrated.scrollback', "Controls the maximum amount of lines the terminal keeps in its buffer."), type: 'number', default: 1000 }, - [TERMINAL_SETTING_ID.DetectLocale]: { + [TerminalSettingId.DetectLocale]: { markdownDescription: localize('terminal.integrated.detectLocale', "Controls whether to detect and set the `$LANG` environment variable to a UTF-8 compliant option since VS Code's terminal only supports UTF-8 encoded data coming from the shell."), type: 'string', enum: ['auto', 'off', 'on'], @@ -490,7 +490,7 @@ export const terminalConfiguration: IConfigurationNode = { ], default: 'auto' }, - [TERMINAL_SETTING_ID.GpuAcceleration]: { + [TerminalSettingId.GpuAcceleration]: { type: 'string', enum: ['auto', 'on', 'off'], markdownEnumDescriptions: [ @@ -501,7 +501,7 @@ export const terminalConfiguration: IConfigurationNode = { default: 'auto', description: localize('terminal.integrated.gpuAcceleration', "Controls whether the terminal will leverage the GPU to do its rendering.") }, - [TERMINAL_SETTING_ID.RightClickBehavior]: { + [TerminalSettingId.RightClickBehavior]: { type: 'string', enum: ['default', 'copyPaste', 'paste', 'selectWord'], enumDescriptions: [ @@ -513,23 +513,23 @@ export const terminalConfiguration: IConfigurationNode = { default: isMacintosh ? 'selectWord' : isWindows ? 'copyPaste' : 'default', description: localize('terminal.integrated.rightClickBehavior', "Controls how terminal reacts to right click.") }, - [TERMINAL_SETTING_ID.Cwd]: { + [TerminalSettingId.Cwd]: { restricted: true, description: localize('terminal.integrated.cwd', "An explicit start path where the terminal will be launched, this is used as the current working directory (cwd) for the shell process. This may be particularly useful in workspace settings if the root directory is not a convenient cwd."), type: 'string', default: undefined }, - [TERMINAL_SETTING_ID.ConfirmOnExit]: { + [TerminalSettingId.ConfirmOnExit]: { description: localize('terminal.integrated.confirmOnExit', "Controls whether to confirm on exit if there are active terminal sessions."), type: 'boolean', default: false }, - [TERMINAL_SETTING_ID.EnableBell]: { + [TerminalSettingId.EnableBell]: { description: localize('terminal.integrated.enableBell', "Controls whether the terminal bell is enabled, this shows up as a visual bell next to the terminal's name."), type: 'boolean', default: false }, - [TERMINAL_SETTING_ID.CommandsToSkipShell]: { + [TerminalSettingId.CommandsToSkipShell]: { markdownDescription: localize('terminal.integrated.commandsToSkipShell', "A set of command IDs whose keybindings will not be sent to the shell but instead always be handled by VS Code. This allows keybindings that would normally be consumed by the shell to act instead the same as when the terminal is not focused, for example `Ctrl+P` to launch Quick Open.\n\n \n\nMany commands are skipped by default. To override a default and pass that command's keybinding to the shell instead, add the command prefixed with the `-` character. For example add `-workbench.action.quickOpen` to allow `Ctrl+P` to reach the shell.\n\n \n\nThe following list of default skipped commands is truncated when viewed in Settings Editor. To see the full list, [open the default settings JSON](command:workbench.action.openRawDefaultSettings 'Open Default Settings (JSON)') and search for the first command from the list below.\n\n \n\nDefault Skipped Commands:\n\n{0}", DEFAULT_COMMANDS_TO_SKIP_SHELL.sort().map(command => `- ${command}`).join('\n')), type: 'array', items: { @@ -537,17 +537,17 @@ export const terminalConfiguration: IConfigurationNode = { }, default: [] }, - [TERMINAL_SETTING_ID.AllowChords]: { + [TerminalSettingId.AllowChords]: { markdownDescription: localize('terminal.integrated.allowChords', "Whether or not to allow chord keybindings in the terminal. Note that when this is true and the keystroke results in a chord it will bypass `#terminal.integrated.commandsToSkipShell#`, setting this to false is particularly useful when you want ctrl+k to go to your shell (not VS Code)."), type: 'boolean', default: true }, - [TERMINAL_SETTING_ID.AllowMnemonics]: { + [TerminalSettingId.AllowMnemonics]: { markdownDescription: localize('terminal.integrated.allowMnemonics', "Whether to allow menubar mnemonics (eg. alt+f) to trigger the open the menubar. Note that this will cause all alt keystrokes to skip the shell when true. This does nothing on macOS."), type: 'boolean', default: false }, - [TERMINAL_SETTING_ID.EnvMacOs]: { + [TerminalSettingId.EnvMacOs]: { restricted: true, markdownDescription: localize('terminal.integrated.env.osx', "Object with environment variables that will be added to the VS Code process to be used by the terminal on macOS. Set to `null` to delete the environment variable."), type: 'object', @@ -556,7 +556,7 @@ export const terminalConfiguration: IConfigurationNode = { }, default: {} }, - [TERMINAL_SETTING_ID.EnvLinux]: { + [TerminalSettingId.EnvLinux]: { restricted: true, markdownDescription: localize('terminal.integrated.env.linux', "Object with environment variables that will be added to the VS Code process to be used by the terminal on Linux. Set to `null` to delete the environment variable."), type: 'object', @@ -565,7 +565,7 @@ export const terminalConfiguration: IConfigurationNode = { }, default: {} }, - [TERMINAL_SETTING_ID.EnvWindows]: { + [TerminalSettingId.EnvWindows]: { restricted: true, markdownDescription: localize('terminal.integrated.env.windows', "Object with environment variables that will be added to the VS Code process to be used by the terminal on Windows. Set to `null` to delete the environment variable."), type: 'object', @@ -574,7 +574,7 @@ export const terminalConfiguration: IConfigurationNode = { }, default: {} }, - [TERMINAL_SETTING_ID.EnvironmentChangesIndicator]: { + [TerminalSettingId.EnvironmentChangesIndicator]: { markdownDescription: localize('terminal.integrated.environmentChangesIndicator', "Whether to display the environment changes indicator on each terminal which explains whether extensions have made, or want to make changes to the terminal's environment."), type: 'string', enum: ['off', 'on', 'warnonly'], @@ -585,17 +585,17 @@ export const terminalConfiguration: IConfigurationNode = { ], default: 'warnonly' }, - [TERMINAL_SETTING_ID.EnvironmentChangesRelaunch]: { + [TerminalSettingId.EnvironmentChangesRelaunch]: { markdownDescription: localize('terminal.integrated.environmentChangesRelaunch', "Whether to relaunch terminals automatically if extension want to contribute to their environment and have not been interacted with yet."), type: 'boolean', default: true }, - [TERMINAL_SETTING_ID.ShowExitAlert]: { + [TerminalSettingId.ShowExitAlert]: { description: localize('terminal.integrated.showExitAlert', "Controls whether to show the alert \"The terminal process terminated with exit code\" when exit code is non-zero."), type: 'boolean', default: true }, - [TERMINAL_SETTING_ID.SplitCwd]: { + [TerminalSettingId.SplitCwd]: { description: localize('terminal.integrated.splitCwd', "Controls the working directory a split terminal starts with."), type: 'string', enum: ['workspaceRoot', 'initial', 'inherited'], @@ -606,27 +606,27 @@ export const terminalConfiguration: IConfigurationNode = { ], default: 'inherited' }, - [TERMINAL_SETTING_ID.WindowsEnableConpty]: { + [TerminalSettingId.WindowsEnableConpty]: { description: localize('terminal.integrated.windowsEnableConpty', "Whether to use ConPTY for Windows terminal process communication (requires Windows 10 build number 18309+). Winpty will be used if this is false."), type: 'boolean', default: true }, - [TERMINAL_SETTING_ID.WordSeparators]: { + [TerminalSettingId.WordSeparators]: { description: localize('terminal.integrated.wordSeparators', "A string containing all characters to be considered word separators by the double click to select word feature."), type: 'string', default: ' ()[]{}\',"`─' }, - [TERMINAL_SETTING_ID.ExperimentalUseTitleEvent]: { + [TerminalSettingId.ExperimentalUseTitleEvent]: { description: localize('terminal.integrated.experimentalUseTitleEvent', "An experimental setting that will use the terminal title event for the dropdown title. This setting will only apply to new terminals."), type: 'boolean', default: false }, - [TERMINAL_SETTING_ID.EnableFileLinks]: { + [TerminalSettingId.EnableFileLinks]: { description: localize('terminal.integrated.enableFileLinks', "Whether to enable file links in the terminal. Links can be slow when working on a network drive in particular because each file link is verified against the file system. Changing this will take effect only in new terminals."), type: 'boolean', default: true }, - [TERMINAL_SETTING_ID.UnicodeVersion]: { + [TerminalSettingId.UnicodeVersion]: { type: 'string', enum: ['6', '11'], enumDescriptions: [ @@ -636,18 +636,18 @@ export const terminalConfiguration: IConfigurationNode = { default: '11', description: localize('terminal.integrated.unicodeVersion', "Controls what version of unicode to use when evaluating the width of characters in the terminal. If you experience emoji or other wide characters not taking up the right amount of space or backspace either deleting too much or too little then you may want to try tweaking this setting.") }, - [TERMINAL_SETTING_ID.ExperimentalLinkProvider]: { + [TerminalSettingId.ExperimentalLinkProvider]: { description: localize('terminal.integrated.experimentalLinkProvider', "An experimental setting that aims to improve link detection in the terminal by improving when links are detected and by enabling shared link detection with the editor. Currently this only supports web links."), type: 'boolean', default: true }, - [TERMINAL_SETTING_ID.LocalEchoLatencyThreshold]: { + [TerminalSettingId.LocalEchoLatencyThreshold]: { description: localize('terminal.integrated.localEchoLatencyThreshold', "Experimental: length of network delay, in milliseconds, where local edits will be echoed on the terminal without waiting for server acknowledgement. If '0', local echo will always be on, and if '-1' it will be disabled."), type: 'integer', minimum: -1, default: 30, }, - [TERMINAL_SETTING_ID.LocalEchoExcludePrograms]: { + [TerminalSettingId.LocalEchoExcludePrograms]: { description: localize('terminal.integrated.localEchoExcludePrograms', "Experimental: local echo will be disabled when any of these program names are found in the terminal title."), type: 'array', items: { @@ -656,7 +656,7 @@ export const terminalConfiguration: IConfigurationNode = { }, default: DEFAULT_LOCAL_ECHO_EXCLUDE, }, - [TERMINAL_SETTING_ID.LocalEchoStyle]: { + [TerminalSettingId.LocalEchoStyle]: { description: localize('terminal.integrated.localEchoStyle', "Experimental: terminal style of locally echoed text; either a font style or an RGB color."), default: 'dim', oneOf: [ @@ -672,12 +672,12 @@ export const terminalConfiguration: IConfigurationNode = { } ] }, - [TERMINAL_SETTING_ID.EnablePersistentSessions]: { + [TerminalSettingId.EnablePersistentSessions]: { description: localize('terminal.integrated.enablePersistentSessions', "Persist terminal sessions for the workspace across window reloads."), type: 'boolean', default: true }, - [TERMINAL_SETTING_ID.AllowWorkspaceConfiguration]: { + [TerminalSettingId.AllowWorkspaceConfiguration]: { scope: ConfigurationScope.APPLICATION, description: localize('terminal.integrated.allowWorkspaceConfiguration', "Allows shell and profile settings to be pick up from a workspace."), type: 'boolean', diff --git a/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts b/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts index 0e8dbef0999..f6d1aff514a 100644 --- a/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts +++ b/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts @@ -11,7 +11,7 @@ import { sanitizeProcessEnvironment } from 'vs/base/common/processes'; import { ILogService } from 'vs/platform/log/common/log'; import { IShellLaunchConfig, ITerminalEnvironment } from 'vs/platform/terminal/common/terminal'; import { IProcessEnvironment, isWindows, locale, OperatingSystem, OS, platform, Platform } from 'vs/base/common/platform'; -import { TERMINAL_SETTING_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { TerminalSettingId } from 'vs/workbench/contrib/terminal/common/terminal'; /** * This module contains utility functions related to the environment, cwd and paths. @@ -238,18 +238,18 @@ function _sanitizeCwd(cwd: string): string { } export type TerminalShellSetting = ( - TERMINAL_SETTING_ID.AutomationShellWindows - | TERMINAL_SETTING_ID.AutomationShellMacOs - | TERMINAL_SETTING_ID.AutomationShellLinux - | TERMINAL_SETTING_ID.ShellWindows - | TERMINAL_SETTING_ID.ShellMacOs - | TERMINAL_SETTING_ID.ShellLinux + TerminalSettingId.AutomationShellWindows + | TerminalSettingId.AutomationShellMacOs + | TerminalSettingId.AutomationShellLinux + | TerminalSettingId.ShellWindows + | TerminalSettingId.ShellMacOs + | TerminalSettingId.ShellLinux ); export type TerminalShellArgsSetting = ( - TERMINAL_SETTING_ID.ShellArgsWindows - | TERMINAL_SETTING_ID.ShellArgsMacOs - | TERMINAL_SETTING_ID.ShellArgsLinux + TerminalSettingId.ShellArgsWindows + | TerminalSettingId.ShellArgsMacOs + | TerminalSettingId.ShellArgsLinux ); export type VariableResolver = (str: string) => string; diff --git a/src/vs/workbench/contrib/terminal/electron-sandbox/terminalRemote.ts b/src/vs/workbench/contrib/terminal/electron-sandbox/terminalRemote.ts index f862a2f43e5..7f086aaa991 100644 --- a/src/vs/workbench/contrib/terminal/electron-sandbox/terminalRemote.ts +++ b/src/vs/workbench/contrib/terminal/electron-sandbox/terminalRemote.ts @@ -7,7 +7,7 @@ import * as nls from 'vs/nls'; import { Registry } from 'vs/platform/registry/common/platform'; import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import { TERMINAL_ACTION_CATEGORY, TERMINAL_COMMAND_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { TERMINAL_ACTION_CATEGORY, TerminalCommandId } from 'vs/workbench/contrib/terminal/common/terminal'; import { Action } from 'vs/base/common/actions'; import { ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal'; import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; @@ -18,7 +18,7 @@ export function registerRemoteContributions() { } export class CreateNewLocalTerminalAction extends Action { - public static readonly ID = TERMINAL_COMMAND_ID.NewLocal; + public static readonly ID = TerminalCommandId.NewLocal; public static readonly LABEL = nls.localize('workbench.action.terminal.newLocal', "Create New Integrated Terminal (Local)"); constructor( diff --git a/src/vs/workbench/contrib/terminal/node/terminalProfiles.ts b/src/vs/workbench/contrib/terminal/node/terminalProfiles.ts index 4280148374f..89cdf939398 100644 --- a/src/vs/workbench/contrib/terminal/node/terminalProfiles.ts +++ b/src/vs/workbench/contrib/terminal/node/terminalProfiles.ts @@ -7,7 +7,7 @@ import * as fs from 'fs'; import { normalize, basename, delimiter } from 'vs/base/common/path'; import { enumeratePowerShellInstallations } from 'vs/base/node/powershell'; import { findExecutable, getWindowsBuildNumber } from 'vs/platform/terminal/node/terminalEnvironment'; -import { ITerminalProfile, ITerminalProfileObject, ProfileSource, TERMINAL_SETTING_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { ITerminalProfile, ITerminalProfileObject, ProfileSource, TerminalSettingId } from 'vs/workbench/contrib/terminal/common/terminal'; import * as cp from 'child_process'; import { ExtHostVariableResolverService } from 'vs/workbench/api/common/extHostDebugService'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; @@ -29,8 +29,8 @@ export function detectAvailableProfiles(configuredProfilesOnly: boolean, safeCon configuredProfilesOnly, fsProvider, logService, - safeConfigProvider(TERMINAL_SETTING_ID.UseWslProfiles) || true, - safeConfigProvider(TERMINAL_SETTING_ID.ProfilesWindows), + safeConfigProvider(TerminalSettingId.UseWslProfiles) || true, + safeConfigProvider(TerminalSettingId.ProfilesWindows), variableResolver, workspaceFolder ); @@ -39,7 +39,7 @@ export function detectAvailableProfiles(configuredProfilesOnly: boolean, safeCon fsProvider, logService, configuredProfilesOnly, - safeConfigProvider(isMacintosh ? TERMINAL_SETTING_ID.ProfilesMacOs : TERMINAL_SETTING_ID.ProfilesLinux), + safeConfigProvider(isMacintosh ? TerminalSettingId.ProfilesMacOs : TerminalSettingId.ProfilesLinux), testPaths, variableResolver, workspaceFolder diff --git a/src/vs/workbench/contrib/watermark/browser/watermark.ts b/src/vs/workbench/contrib/watermark/browser/watermark.ts index 66b0aa38619..52284e2b6c2 100644 --- a/src/vs/workbench/contrib/watermark/browser/watermark.ts +++ b/src/vs/workbench/contrib/watermark/browser/watermark.ts @@ -22,7 +22,7 @@ import * as dom from 'vs/base/browser/dom'; import { KeybindingLabel } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { TERMINAL_COMMAND_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { TerminalCommandId } from 'vs/workbench/contrib/terminal/common/terminal'; import { assertIsDefined } from 'vs/base/common/types'; import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuration'; import { NEW_UNTITLED_FILE_COMMAND_ID } from 'vs/workbench/contrib/files/browser/fileCommands'; @@ -46,7 +46,7 @@ const openFileOrFolderMacOnly: WatermarkEntry = { text: nls.localize('watermark. const openRecent: WatermarkEntry = { text: nls.localize('watermark.openRecent', "Open Recent"), id: 'workbench.action.openRecent' }; const newUntitledFile: WatermarkEntry = { text: nls.localize('watermark.newUntitledFile', "New Untitled File"), id: NEW_UNTITLED_FILE_COMMAND_ID }; const newUntitledFileMacOnly: WatermarkEntry = Object.assign({ mac: true }, newUntitledFile); -const toggleTerminal: WatermarkEntry = { text: nls.localize({ key: 'watermark.toggleTerminal', comment: ['toggle is a verb here'] }, "Toggle Terminal"), id: TERMINAL_COMMAND_ID.Toggle }; +const toggleTerminal: WatermarkEntry = { text: nls.localize({ key: 'watermark.toggleTerminal', comment: ['toggle is a verb here'] }, "Toggle Terminal"), id: TerminalCommandId.Toggle }; const findInFiles: WatermarkEntry = { text: nls.localize('watermark.findInFiles', "Find in Files"), id: FindInFilesActionId }; const startDebugging: WatermarkEntry = { text: nls.localize('watermark.startDebugging', "Start Debugging"), id: DEBUG_START_COMMAND_ID };