未验证 提交 54834403 编写于 作者: D Daniel Imms 提交者: GitHub

Merge pull request #57100 from ParkourKarthik/improve-handling-terminal-colors

improve handling fallback of theme colors in terminal
......@@ -5,7 +5,8 @@
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';
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
......@@ -13,7 +14,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',
......@@ -26,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': {
......
......@@ -310,10 +310,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()}; }`);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册