提交 88422dd4 编写于 作者: D Daniel Imms 提交者: GitHub

Merge pull request #26052 from Microsoft/tyriar/24735

Support terminal bg and fg color keys
......@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
.monaco-workbench .panel.integrated-terminal .xterm {
background-color: transparent!important;
position: relative;
height: 100%;
}
......
......@@ -13,6 +13,9 @@ 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_FOREGROUND_COLOR = registerColor('terminal.foreground', null, nls.localize('terminal.foreground', 'The foreground color of the terminal.'));
const ansiColorMap = {
'terminal.ansiBlack': {
index: 0,
......@@ -150,4 +153,5 @@ export function registerColors(): void {
let colorName = id.substring(13);
ansiColorIdentifiers[entry.index] = registerColor(id, entry.defaults, nls.localize('terminal.ansiColor', '\'{0}\' ansi color in the terminal.', colorName));
}
}
......@@ -16,7 +16,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { ITerminalService, ITerminalFont, TERMINAL_PANEL_ID } from 'vs/workbench/parts/terminal/common/terminal';
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
import { ansiColorIdentifiers } from './terminalColorRegistry';
import { ansiColorIdentifiers, TERMINAL_BACKGROUND_COLOR, TERMINAL_FOREGROUND_COLOR } from './terminalColorRegistry';
import { ColorIdentifier } from 'vs/platform/theme/common/colorRegistry';
import { KillTerminalAction, CreateNewTerminalAction, SwitchTerminalInstanceAction, SwitchTerminalInstanceActionItem, CopyTerminalSelectionAction, TerminalPasteAction, ClearTerminalAction } from 'vs/workbench/parts/terminal/electron-browser/terminalActions';
import { Panel } from 'vs/workbench/browser/panel';
......@@ -226,6 +226,14 @@ export class TerminalPanel extends Panel {
`.monaco-workbench .panel.integrated-terminal .xterm .xterm-bg-color-${index}::selection { color: ${color}; }`;
}
});
const bgColor = theme.getColor(TERMINAL_BACKGROUND_COLOR);
if (bgColor) {
css += `.monaco-workbench .panel.integrated-terminal .terminal-outer-container { background-color: ${bgColor}; }`;
}
const fgColor = theme.getColor(TERMINAL_FOREGROUND_COLOR);
if (bgColor) {
css += `.monaco-workbench .panel.integrated-terminal .xterm { color: ${fgColor}; }`;
}
this._themeStyleElement.innerHTML = css;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册