From 0b5cef4f76cf8217d64123adb5b68fbff0873410 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 4 Aug 2022 06:59:43 -0700 Subject: [PATCH] Remove shell decoration icon settings Fixes #156503 --- src/vs/platform/terminal/common/terminal.ts | 3 --- .../terminal/browser/xterm/decorationAddon.ts | 26 +++++-------------- .../terminal/common/terminalConfiguration.ts | 15 ----------- 3 files changed, 7 insertions(+), 37 deletions(-) diff --git a/src/vs/platform/terminal/common/terminal.ts b/src/vs/platform/terminal/common/terminal.ts index 6721816d4ec..80633905e94 100644 --- a/src/vs/platform/terminal/common/terminal.ts +++ b/src/vs/platform/terminal/common/terminal.ts @@ -109,9 +109,6 @@ export const enum TerminalSettingId { ShellIntegrationEnabled = 'terminal.integrated.shellIntegration.enabled', ShellIntegrationShowWelcome = 'terminal.integrated.shellIntegration.showWelcome', ShellIntegrationDecorationsEnabled = 'terminal.integrated.shellIntegration.decorationsEnabled', - ShellIntegrationDecorationIcon = 'terminal.integrated.shellIntegration.decorationIcon', - ShellIntegrationDecorationIconError = 'terminal.integrated.shellIntegration.decorationIconError', - ShellIntegrationDecorationIconSuccess = 'terminal.integrated.shellIntegration.decorationIconSuccess', ShellIntegrationCommandHistory = 'terminal.integrated.shellIntegration.history', SmoothScrolling = 'terminal.integrated.smoothScrolling' } diff --git a/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts b/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts index dedbc805e9b..901cb67a0dc 100644 --- a/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts +++ b/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts @@ -37,7 +37,6 @@ const enum DecorationSelector { Default = 'default', Codicon = 'codicon', XtermDecoration = 'xterm-decoration', - GenericMarkerIcon = 'codicon-circle-small-filled', OverviewRuler = '.xterm-decoration-overview-ruler' } @@ -79,11 +78,7 @@ export class DecorationAddon extends Disposable implements ITerminalAddon { this._hoverDelayer = this._register(new Delayer(this._configurationService.getValue('workbench.hover.delay'))); this._register(this._configurationService.onDidChangeConfiguration(e => { - if (e.affectsConfiguration(TerminalSettingId.ShellIntegrationDecorationIcon) || - e.affectsConfiguration(TerminalSettingId.ShellIntegrationDecorationIconSuccess) || - e.affectsConfiguration(TerminalSettingId.ShellIntegrationDecorationIconError)) { - this._refreshStyles(); - } else if (e.affectsConfiguration(TerminalSettingId.FontSize) || e.affectsConfiguration(TerminalSettingId.LineHeight)) { + if (e.affectsConfiguration(TerminalSettingId.FontSize) || e.affectsConfiguration(TerminalSettingId.LineHeight)) { this.refreshLayouts(); } else if (e.affectsConfiguration('workbench.colorCustomizations')) { this._refreshStyles(true); @@ -338,7 +333,7 @@ export class DecorationAddon extends Disposable implements ITerminalAddon { element.classList.add(DecorationSelector.CommandDecoration, DecorationSelector.Codicon, DecorationSelector.XtermDecoration); if (genericMarkProperties) { - element.classList.add(DecorationSelector.DefaultColor, DecorationSelector.GenericMarkerIcon); + element.classList.add(DecorationSelector.DefaultColor, ...Codicon.terminalDecorationMark.classNamesArray); if (!genericMarkProperties.hoverMessage) { //disable the mouse pointer element.classList.add(DecorationSelector.Default); @@ -348,12 +343,12 @@ export class DecorationAddon extends Disposable implements ITerminalAddon { this._updateCommandDecorationVisibility(element); if (exitCode === undefined) { element.classList.add(DecorationSelector.DefaultColor, DecorationSelector.Default); - element.classList.add(`codicon-${this._configurationService.getValue(TerminalSettingId.ShellIntegrationDecorationIcon)}`); + element.classList.add(...Codicon.terminalDecorationIncomplete.classNamesArray); } else if (exitCode) { element.classList.add(DecorationSelector.ErrorColor); - element.classList.add(`codicon-${this._configurationService.getValue(TerminalSettingId.ShellIntegrationDecorationIconError)}`); + element.classList.add(...Codicon.terminalDecorationError.classNamesArray); } else { - element.classList.add(`codicon-${this._configurationService.getValue(TerminalSettingId.ShellIntegrationDecorationIconSuccess)}`); + element.classList.add(...Codicon.terminalDecorationSuccess.classNamesArray); } } } @@ -453,11 +448,7 @@ export class DecorationAddon extends Disposable implements ITerminalAddon { private async _showConfigureCommandDecorationsQuickPick() { const quickPick = this._quickInputService.createQuickPick(); quickPick.items = [ - { id: 'a', label: localize('changeDefaultIcon', 'Change default icon') }, - { id: 'b', label: localize('changeSuccessIcon', 'Change success icon') }, - { id: 'c', label: localize('changeErrorIcon', 'Change error icon') }, - { type: 'separator' }, - { id: 'd', label: localize('toggleVisibility', 'Toggle visibility') }, + { id: 'a', label: localize('toggleVisibility', 'Toggle visibility') }, ]; quickPick.canSelectMany = false; quickPick.onDidAccept(async e => { @@ -465,10 +456,7 @@ export class DecorationAddon extends Disposable implements ITerminalAddon { const result = quickPick.activeItems[0]; let iconSetting: string | undefined; switch (result.id) { - case 'a': iconSetting = TerminalSettingId.ShellIntegrationDecorationIcon; break; - case 'b': iconSetting = TerminalSettingId.ShellIntegrationDecorationIconSuccess; break; - case 'c': iconSetting = TerminalSettingId.ShellIntegrationDecorationIconError; break; - case 'd': this._showToggleVisibilityQuickPick(); break; + case 'a': this._showToggleVisibilityQuickPick(); break; } if (iconSetting) { this._showChangeIconQuickPick(iconSetting); diff --git a/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts b/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts index 30fe86a21d0..790e1777020 100644 --- a/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts +++ b/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts @@ -116,21 +116,6 @@ const terminalConfiguration: IConfigurationNode = { default: 'view', description: localize('terminal.integrated.defaultLocation', "Controls where newly created terminals will appear.") }, - [TerminalSettingId.ShellIntegrationDecorationIconSuccess]: { - type: 'string', - default: 'primitive-dot', - markdownDescription: localize('terminal.integrated.shellIntegration.decorationIconSuccess', "Controls the icon that will be used for each command in terminals with shell integration enabled that do not have an associated exit code. Set to {0} to hide the icon or disable decorations with {1}.", '`\"\"`', '`#terminal.integrated.shellIntegration.decorationsEnabled#`') - }, - [TerminalSettingId.ShellIntegrationDecorationIconError]: { - type: 'string', - default: 'error-small', - markdownDescription: localize('terminal.integrated.shellIntegration.decorationIconError', "Controls the icon that will be used for each command in terminals with shell integration enabled that do have an associated exit code. Set to {0} to hide the icon or disable decorations with {1}.", '`\"\"`', '`#terminal.integrated.shellIntegration.decorationsEnabled#`') - }, - [TerminalSettingId.ShellIntegrationDecorationIcon]: { - type: 'string', - default: 'circle-outline', - markdownDescription: localize('terminal.integrated.shellIntegration.decorationIcon', "Controls the icon that will be used for skipped/empty commands. Set to {0} to hide the icon or disable decorations with {1}.", '`\"\"`', '`#terminal.integrated.shellIntegration.decorationsEnabled#`') - }, [TerminalSettingId.TabsFocusMode]: { type: 'string', enum: ['singleClick', 'doubleClick'],