提交 2b251d6e 编写于 作者: D Daniel Imms

Add rendererType terminal setting

上级 048f609a
......@@ -63,6 +63,7 @@ export interface ITerminalConfiguration {
windows: string[];
};
macOptionIsMeta: boolean;
rendererType: 'auto' | 'canvas' | 'dom';
rightClickBehavior: 'default' | 'copyPaste' | 'selectWord';
cursorBlinking: boolean;
cursorStyle: string;
......
......@@ -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."),
......
......@@ -249,19 +249,22 @@ export class TerminalInstance implements ITerminalInstance {
}
const accessibilitySupport = this._configurationService.getValue<IEditorOptions>('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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册