Skip to content

Commit

Permalink
fix #143205
Browse files Browse the repository at this point in the history
  • Loading branch information
meganrogge committed Feb 16, 2022
1 parent 9bf9403 commit 1d83805
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { fromNow } from 'vs/base/common/date';
import { toolbarHoverBackground } from 'vs/platform/theme/common/colorRegistry';
import { TerminalSettingId } from 'vs/platform/terminal/common/terminal';
import { editorGutterDeletedBackground, editorGutterModifiedBackground } from 'vs/workbench/contrib/scm/browser/dirtydiffDecorator';
import { TERMINAL_COMMAND_DECORATION_SKIPPED_BACKGROUND_COLOR } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry';
import { TERMINAL_COMMAND_DECORATION_DEFAULT_BACKGROUND_COLOR, TERMINAL_COMMAND_DECORATION_ERROR_BACKGROUND_COLOR, TERMINAL_COMMAND_DECORATION_SKIPPED_BACKGROUND_COLOR } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry';

const enum DecorationSelector {
CommandDecoration = 'terminal-command-decoration',
Expand Down Expand Up @@ -191,8 +190,8 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
}

registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
const defaultColor = theme.getColor(editorGutterModifiedBackground);
const errorColor = theme.getColor(editorGutterDeletedBackground);
const defaultColor = theme.getColor(TERMINAL_COMMAND_DECORATION_DEFAULT_BACKGROUND_COLOR);
const errorColor = theme.getColor(TERMINAL_COMMAND_DECORATION_ERROR_BACKGROUND_COLOR);
const skippedColor = theme.getColor(TERMINAL_COMMAND_DECORATION_SKIPPED_BACKGROUND_COLOR);
const hoverBackgroundColor = theme.getColor(toolbarHoverBackground);
if (!defaultColor || !errorColor || !skippedColor || !hoverBackgroundColor) {
Expand Down
11 changes: 11 additions & 0 deletions src/vs/workbench/contrib/terminal/common/terminalColorRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as nls from 'vs/nls';

import { registerColor, ColorIdentifier, ColorDefaults } from 'vs/platform/theme/common/colorRegistry';
import { EDITOR_DRAG_AND_DROP_BACKGROUND, PANEL_BORDER, TAB_ACTIVE_BORDER } from 'vs/workbench/common/theme';
import { editorGutterDeletedBackground, editorGutterModifiedBackground } from 'vs/workbench/contrib/scm/browser/dirtydiffDecorator';

/**
* The color identifiers for the terminal's ansi colors. The index in the array corresponds to the index
Expand All @@ -27,6 +28,16 @@ export const TERMINAL_SELECTION_BACKGROUND_COLOR = registerColor('terminal.selec
dark: '#FFFFFF40',
hc: '#FFFFFF80'
}, nls.localize('terminal.selectionBackground', 'The selection background color of the terminal.'));
export const TERMINAL_COMMAND_DECORATION_DEFAULT_BACKGROUND_COLOR = registerColor('terminalCommandDecoration.defaultBackground', {
light: editorGutterModifiedBackground,
dark: editorGutterModifiedBackground,
hc: editorGutterModifiedBackground
}, nls.localize('terminalCommandDecoration.defaultBackground', 'The default terminal command decoration background color for successful commands (zero exit code).'));
export const TERMINAL_COMMAND_DECORATION_ERROR_BACKGROUND_COLOR = registerColor('terminalCommandDecoration.errorBackground', {
light: editorGutterDeletedBackground,
dark: editorGutterDeletedBackground,
hc: editorGutterDeletedBackground
}, nls.localize('terminalCommandDecoration.errorBackground', 'The terminal command decoration background color when the command fails (non-zero exit code).'));
export const TERMINAL_COMMAND_DECORATION_SKIPPED_BACKGROUND_COLOR = registerColor('terminalCommandDecoration.skippedBackground', {
light: '#00000040',
dark: '#ffffff40',
Expand Down

1 comment on commit 1d83805

@meganrogge
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is layer breaking @Tyriar, so reverting to what I had before

Please sign in to comment.