diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/xterm.css b/src/vs/workbench/parts/terminal/electron-browser/media/xterm.css index 66487fab2141f..866fc265e4fd8 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/media/xterm.css +++ b/src/vs/workbench/parts/terminal/electron-browser/media/xterm.css @@ -140,14 +140,6 @@ .monaco-workbench .panel.integrated-terminal .xterm .xterm-selection div { position: absolute; - opacity: 0.5; - background-color: #808080; -} -.vs-dark .monaco-workbench .panel.integrated-terminal .xterm .xterm-selection div { - background-color: #808080; -} -.hc-black .monaco-workbench .panel.integrated-terminal .xterm .xterm-selection div { - background-color: #FFF; } .monaco-workbench .panel.integrated-terminal .xterm .xterm-bold { diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.ts index ae1d524a91223..92206287ac904 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.ts @@ -17,8 +17,13 @@ export const TERMINAL_BACKGROUND_COLOR = registerColor('terminal.background', nu export const TERMINAL_FOREGROUND_COLOR = registerColor('terminal.foreground', { light: '#333333', dark: '#CCCCCC', - hc: 'FFFFFF' + hc: '#FFFFFF' }, nls.localize('terminal.foreground', 'The foreground color of the terminal.')); +export const TERMINAL_SELECTION_BACKGROUND_COLOR = registerColor('terminal.selectionBackground', { + light: '#B0B0B0', + dark: '#404040', + hc: '#808080' +}, nls.localize('terminal.selectionBackground', 'The selection background color of the terminal.')); 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 ee9222682125f..7d362f8440b17 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts @@ -16,8 +16,8 @@ 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 { TerminalFindWidget } from './terminalFindWidget'; -import { ansiColorIdentifiers, TERMINAL_BACKGROUND_COLOR, TERMINAL_FOREGROUND_COLOR } from './terminalColorRegistry'; -import { ColorIdentifier, selectionBackground } from 'vs/platform/theme/common/colorRegistry'; +import { ansiColorIdentifiers, TERMINAL_BACKGROUND_COLOR, TERMINAL_FOREGROUND_COLOR, TERMINAL_SELECTION_BACKGROUND_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'; import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; @@ -277,13 +277,9 @@ export class TerminalPanel extends Panel { `.monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-bar.focus.xterm-cursor-blink .terminal-cursor::before,` + `.monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-underline.focus.xterm-cursor-blink .terminal-cursor::before { background-color: ${fgColor}; }`; } - // Use selection.background as the terminal selection, this is temporary - // until proper color inverting is implemented to ensure contrast. - const selectionColor = theme.getColor(selectionBackground); + const selectionColor = theme.getColor(TERMINAL_SELECTION_BACKGROUND_COLOR); if (selectionColor) { - // selection.background is set to null when not defined by the - // theme, as such it's default values are defined in CSS. - css += `.monaco-workbench .panel.integrated-terminal .xterm .xterm-selection div { background-color: ${selectionColor} !important; }`; + css += `.monaco-workbench .panel.integrated-terminal .xterm .xterm-selection div { background-color: ${selectionColor}; }`; } this._themeStyleElement.innerHTML = css;