diff --git a/src/vs/workbench/parts/terminal/common/terminal.ts b/src/vs/workbench/parts/terminal/common/terminal.ts index f8fdd316c39..ccff25889b4 100644 --- a/src/vs/workbench/parts/terminal/common/terminal.ts +++ b/src/vs/workbench/parts/terminal/common/terminal.ts @@ -63,6 +63,7 @@ export interface ITerminalConfiguration { windows: string[]; }; macOptionIsMeta: boolean; + rendererType: 'auto' | 'canvas' | 'dom'; rightClickBehavior: 'default' | 'copyPaste' | 'selectWord'; cursorBlinking: boolean; cursorStyle: string; diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts b/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts index 42fb54a9fd5..d2708f7415b 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts @@ -182,11 +182,17 @@ configurationRegistry.registerConfiguration({ 'type': 'boolean', 'default': platform.isMacintosh }, + 'terminal.integrated.rendererType': { + 'type': 'string', + 'enum': ['auto', 'canvas', 'dom'], + default: 'auto', + description: nls.localize('terminal.integrated.rendererType', "Controls how the terminal is rendered, the options are \"canvas\" for the standard canvas renderer, \"dom\" for the fallback DOM-based renderer or \"auto\" which lets VS Code guess which will be best. This setting needs VS Code to reload in order to take effect for new terminals.") + }, 'terminal.integrated.rightClickBehavior': { 'type': 'string', 'enum': ['default', 'copyPaste', 'selectWord'], default: platform.isMacintosh ? 'selectWord' : platform.isWindows ? 'copyPaste' : 'default', - description: nls.localize('terminal.integrated.rightClickBehavior', "Controls how terminal reacts to right click, possibilities are 'default', 'copyPaste', and 'selectWord'. 'default' will show the context menu, 'copyPaste' will copy when there is a selection otherwise paste, 'selectWord' will select the word under the cursor and show the context menu.") + description: nls.localize('terminal.integrated.rightClickBehavior', "Controls how terminal reacts to right click, possibilities are \"default\", \"copyPaste\", and \"selectWord\". \"default\" will show the context menu, \"copyPaste\" will copy when there is a selection otherwise paste, \"selectWord\" will select the word under the cursor and show the context menu.") }, 'terminal.integrated.cwd': { 'description': nls.localize('terminal.integrated.cwd', "An explicit start path where the terminal will be launched, this is used as the current working directory (cwd) for the shell process. This may be particularly useful in workspace settings if the root directory is not a convenient cwd."), diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts index 6356dcf5fa9..fbdf76a1b89 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts @@ -249,19 +249,22 @@ export class TerminalInstance implements ITerminalInstance { } const accessibilitySupport = this._configurationService.getValue('editor').accessibilitySupport; const font = this._configHelper.getFont(undefined, true); + const config = this._configHelper.config; this._xterm = new Terminal({ - scrollback: this._configHelper.config.scrollback, + scrollback: config.scrollback, theme: this._getXtermTheme(), fontFamily: font.fontFamily, - fontWeight: this._configHelper.config.fontWeight, - fontWeightBold: this._configHelper.config.fontWeightBold, + fontWeight: config.fontWeight, + fontWeightBold: config.fontWeightBold, fontSize: font.fontSize, letterSpacing: font.letterSpacing, lineHeight: font.lineHeight, - bellStyle: this._configHelper.config.enableBell ? 'sound' : 'none', + bellStyle: config.enableBell ? 'sound' : 'none', screenReaderMode: accessibilitySupport === 'on', - macOptionIsMeta: this._configHelper.config.macOptionIsMeta, - rightClickSelectsWord: this._configHelper.config.rightClickBehavior === 'selectWord' + macOptionIsMeta: config.macOptionIsMeta, + rightClickSelectsWord: config.rightClickBehavior === 'selectWord', + // TODO: Guess whether to use canvas or dom better + rendererType: config.rendererType === 'auto' ? 'canvas' : config.rendererType }); if (this._shellLaunchConfig.initialText) { this._xterm.writeln(this._shellLaunchConfig.initialText);