From 1624f3854ce6d194c1deed744c43896f45e159aa Mon Sep 17 00:00:00 2001 From: Parkour Karthik Date: Fri, 24 Aug 2018 00:01:17 +0530 Subject: [PATCH 1/2] improve handling fallback of background color --- .../parts/terminal/common/terminalColorRegistry.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/parts/terminal/common/terminalColorRegistry.ts b/src/vs/workbench/parts/terminal/common/terminalColorRegistry.ts index f002de9397b53..1891b457edf63 100644 --- a/src/vs/workbench/parts/terminal/common/terminalColorRegistry.ts +++ b/src/vs/workbench/parts/terminal/common/terminalColorRegistry.ts @@ -5,7 +5,7 @@ import * as nls from 'vs/nls'; -import { registerColor, ColorIdentifier } from 'vs/platform/theme/common/colorRegistry'; +import { editorBackground, registerColor, ColorIdentifier } from 'vs/platform/theme/common/colorRegistry'; /** * The color identifiers for the terminal's ansi colors. The index in the array corresponds to the index @@ -13,7 +13,11 @@ import { registerColor, ColorIdentifier } from 'vs/platform/theme/common/colorRe */ export const ansiColorIdentifiers: ColorIdentifier[] = []; -export const TERMINAL_BACKGROUND_COLOR = registerColor('terminal.background', null, nls.localize('terminal.background', 'The background color of the terminal, this allows coloring the terminal differently to the panel.')); +export const TERMINAL_BACKGROUND_COLOR = registerColor('terminal.background', { + dark: editorBackground, + light: editorBackground, + hc: editorBackground +}, nls.localize('terminal.background', 'The background color of the terminal, this allows coloring the terminal differently to the panel.')); export const TERMINAL_FOREGROUND_COLOR = registerColor('terminal.foreground', { light: '#333333', dark: '#CCCCCC', From 9633e4137ca6abfce7f070de2af0414a707efa48 Mon Sep 17 00:00:00 2001 From: Parkour Karthik Date: Sat, 25 Aug 2018 00:59:13 +0530 Subject: [PATCH 2/2] improve handling fallback of terminal border color --- .../parts/terminal/common/terminalColorRegistry.ts | 7 ++++++- .../parts/terminal/electron-browser/terminalPanel.ts | 5 ++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/parts/terminal/common/terminalColorRegistry.ts b/src/vs/workbench/parts/terminal/common/terminalColorRegistry.ts index 1891b457edf63..00c8c07d40267 100644 --- a/src/vs/workbench/parts/terminal/common/terminalColorRegistry.ts +++ b/src/vs/workbench/parts/terminal/common/terminalColorRegistry.ts @@ -6,6 +6,7 @@ import * as nls from 'vs/nls'; import { editorBackground, registerColor, ColorIdentifier } from 'vs/platform/theme/common/colorRegistry'; +import { PANEL_BORDER } from 'vs/workbench/common/theme'; /** * The color identifiers for the terminal's ansi colors. The index in the array corresponds to the index @@ -30,7 +31,11 @@ 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_BORDER_COLOR = registerColor('terminal.border', null, nls.localize('terminal.border', 'The color of the border that separates split panes within the terminal. This defaults to panel.border.')); +export const TERMINAL_BORDER_COLOR = registerColor('terminal.border', { + dark: PANEL_BORDER, + light: PANEL_BORDER, + hc: PANEL_BORDER +}, nls.localize('terminal.border', 'The color of the border that separates split panes within the terminal. This defaults to panel.border.')); const ansiColorMap = { 'terminal.ansiBlack': { diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts index 4e1b4891f83e4..8b726c2403e24 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts @@ -22,7 +22,6 @@ import { Panel } from 'vs/workbench/browser/panel'; import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; import { TPromise } from 'vs/base/common/winjs.base'; import URI from 'vs/base/common/uri'; -import { PANEL_BACKGROUND, PANEL_BORDER } from 'vs/workbench/common/theme'; import { TERMINAL_BACKGROUND_COLOR, TERMINAL_BORDER_COLOR } from 'vs/workbench/parts/terminal/common/terminalColorRegistry'; import { DataTransfers } from 'vs/base/browser/dnd'; import { INotificationService, IPromptChoice, Severity } from 'vs/platform/notification/common/notification'; @@ -310,10 +309,10 @@ export class TerminalPanel extends Panel { } registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { - const backgroundColor = theme.getColor(TERMINAL_BACKGROUND_COLOR) || theme.getColor(PANEL_BACKGROUND); + const backgroundColor = theme.getColor(TERMINAL_BACKGROUND_COLOR); collector.addRule(`.monaco-workbench .panel.integrated-terminal .terminal-outer-container { background-color: ${backgroundColor ? backgroundColor.toString() : ''}; }`); - const borderColor = theme.getColor(TERMINAL_BORDER_COLOR) || theme.getColor(PANEL_BORDER); + const borderColor = theme.getColor(TERMINAL_BORDER_COLOR); if (borderColor) { collector.addRule(`.monaco-workbench .panel.integrated-terminal .split-view-view:not(:first-child) { border-color: ${borderColor.toString()}; }`); }