提交 432fa81e 编写于 作者: D Daniel Imms

Uplevel xterm.js and implement flowControl setting

Fixes #18833
上级 f161b43e
...@@ -432,7 +432,7 @@ ...@@ -432,7 +432,7 @@
"xterm": { "xterm": {
"version": "2.2.3", "version": "2.2.3",
"from": "git+https://github.com/Tyriar/xterm.js.git#vscode-release/1.9", "from": "git+https://github.com/Tyriar/xterm.js.git#vscode-release/1.9",
"resolved": "git+https://github.com/Tyriar/xterm.js.git#f30504b908ff9c9e1917add36353da66b176e08a" "resolved": "git+https://github.com/Tyriar/xterm.js.git#27f7052106825b7e2e89358bed84bb1a285d7aaf"
}, },
"yauzl": { "yauzl": {
"version": "2.3.1", "version": "2.3.1",
......
...@@ -58,7 +58,8 @@ export interface ITerminalConfiguration { ...@@ -58,7 +58,8 @@ export interface ITerminalConfiguration {
setLocaleVariables: boolean, setLocaleVariables: boolean,
scrollback: number, scrollback: number,
commandsToSkipShell: string[], commandsToSkipShell: string[],
cwd: string cwd: string,
flowControl: boolean
} }
}; };
} }
...@@ -67,6 +68,7 @@ export interface ITerminalConfigHelper { ...@@ -67,6 +68,7 @@ export interface ITerminalConfigHelper {
getTheme(baseThemeId: string): string[]; getTheme(baseThemeId: string): string[];
getFont(): ITerminalFont; getFont(): ITerminalFont;
getFontLigaturesEnabled(): boolean; getFontLigaturesEnabled(): boolean;
getFlowControl(): boolean;
getCursorBlink(): boolean; getCursorBlink(): boolean;
getRightClickCopyPaste(): boolean; getRightClickCopyPaste(): boolean;
getCommandsToSkipShell(): string[]; getCommandsToSkipShell(): string[];
......
...@@ -12,7 +12,7 @@ import nls = require('vs/nls'); ...@@ -12,7 +12,7 @@ import nls = require('vs/nls');
import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
import { GlobalQuickOpenAction } from 'vs/workbench/browser/parts/quickopen/quickopen.contribution'; import { GlobalQuickOpenAction } from 'vs/workbench/browser/parts/quickopen/quickopen.contribution';
import { ITerminalService, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_PANEL_ID, TERMINAL_DEFAULT_RIGHT_CLICK_COPY_PASTE, TerminalCursorStyle } from 'vs/workbench/parts/terminal/common/terminal'; import { ITerminalService, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_PANEL_ID, TERMINAL_DEFAULT_RIGHT_CLICK_COPY_PASTE, TerminalCursorStyle } from 'vs/workbench/parts/terminal/common/terminal';
import { TERMINAL_DEFAULT_SHELL_LINUX, TERMINAL_DEFAULT_SHELL_OSX, TERMINAL_DEFAULT_SHELL_WINDOWS } from 'vs/workbench/parts/terminal/electron-browser/terminal'; import { TERMINAL_DEFAULT_SHELL_LINUX, TERMINAL_DEFAULT_SHELL_OSX, TERMINAL_DEFAULT_SHELL_WINDOWS, TERMINAL_DEFAULT_FLOW_CONTROL } from 'vs/workbench/parts/terminal/electron-browser/terminal';
import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
...@@ -119,6 +119,11 @@ configurationRegistry.registerConfiguration({ ...@@ -119,6 +119,11 @@ configurationRegistry.registerConfiguration({
'type': 'number', 'type': 'number',
'default': 1000 'default': 1000
}, },
'terminal.integrated.flowControl': {
'description': nls.localize('terminal.integrated.flowControl', "Controls the whether the terminal emulator will use flow control in order to catch up with the shell process, the main effect of this is that ^C and other signals should be much more responsive when commands give lots of output. You should this disabled if you have custom ^S or ^Q keybindings that override the XOFF and XON signals used."),
'type': 'boolean',
'default': TERMINAL_DEFAULT_FLOW_CONTROL
},
'terminal.integrated.setLocaleVariables': { 'terminal.integrated.setLocaleVariables': {
'description': nls.localize('terminal.integrated.setLocaleVariables', "Controls whether locale variables are set at startup of the terminal, this defaults to true on OS X, false on other platforms."), 'description': nls.localize('terminal.integrated.setLocaleVariables', "Controls whether locale variables are set at startup of the terminal, this defaults to true on OS X, false on other platforms."),
'type': 'boolean', 'type': 'boolean',
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
'use strict'; 'use strict';
import * as os from 'os'; import * as os from 'os';
import * as path from 'path';
import * as cp from 'child_process'; import * as cp from 'child_process';
import platform = require('vs/base/common/platform'); import platform = require('vs/base/common/platform');
import processes = require('vs/base/node/processes'); import processes = require('vs/base/node/processes');
...@@ -18,6 +19,11 @@ const powerShellPath = `${process.env.windir}\\${is64BitWindows ? 'Sysnative' : ...@@ -18,6 +19,11 @@ const powerShellPath = `${process.env.windir}\\${is64BitWindows ? 'Sysnative' :
export const TERMINAL_DEFAULT_SHELL_WINDOWS = isAtLeastWindows10 ? powerShellPath : processes.getWindowsShell(); export const TERMINAL_DEFAULT_SHELL_WINDOWS = isAtLeastWindows10 ? powerShellPath : processes.getWindowsShell();
// Terminal flow control is disabled if the shell is zsh since the popular oh-my-zsh configuration
// overrides the ^S and ^Q keybindings which are used for flow control.
// TODO: This should check if ~/.oh-my-zsh exists as well
export const TERMINAL_DEFAULT_FLOW_CONTROL = path.basename(process.env.SHELL) !== 'zsh';
export interface ITerminalProcessFactory { export interface ITerminalProcessFactory {
create(env: { [key: string]: string }): cp.ChildProcess; create(env: { [key: string]: string }): cp.ChildProcess;
} }
...@@ -137,6 +137,11 @@ export class TerminalConfigHelper implements ITerminalConfigHelper { ...@@ -137,6 +137,11 @@ export class TerminalConfigHelper implements ITerminalConfigHelper {
return terminalConfig.terminal.integrated.fontLigatures; return terminalConfig.terminal.integrated.fontLigatures;
} }
public getFlowControl(): boolean {
const terminalConfig = this._configurationService.getConfiguration<ITerminalConfiguration>();
return terminalConfig.terminal.integrated.flowControl;
}
public getCursorBlink(): boolean { public getCursorBlink(): boolean {
const terminalConfig = this._configurationService.getConfiguration<ITerminalConfiguration>(); const terminalConfig = this._configurationService.getConfiguration<ITerminalConfiguration>();
return terminalConfig.terminal.integrated.cursorBlinking; return terminalConfig.terminal.integrated.cursorBlinking;
......
...@@ -543,12 +543,19 @@ export class TerminalInstance implements ITerminalInstance { ...@@ -543,12 +543,19 @@ export class TerminalInstance implements ITerminalInstance {
} }
public updateConfig(): void { public updateConfig(): void {
this._setFlowControl(this._configHelper.getFlowControl());
this._setCursorBlink(this._configHelper.getCursorBlink()); this._setCursorBlink(this._configHelper.getCursorBlink());
this._setCursorStyle(this._configHelper.getCursorStyle()); this._setCursorStyle(this._configHelper.getCursorStyle());
this._setCommandsToSkipShell(this._configHelper.getCommandsToSkipShell()); this._setCommandsToSkipShell(this._configHelper.getCommandsToSkipShell());
this._setScrollback(this._configHelper.getScrollback()); this._setScrollback(this._configHelper.getScrollback());
} }
private _setFlowControl(flowControl: boolean): void {
if (this._xterm && this._xterm.getOption('useFlowControl') !== flowControl) {
this._xterm.setOption('useFlowControl', flowControl);
}
}
private _setCursorBlink(blink: boolean): void { private _setCursorBlink(blink: boolean): void {
if (this._xterm && this._xterm.getOption('cursorBlink') !== blink) { if (this._xterm && this._xterm.getOption('cursorBlink') !== blink) {
this._xterm.setOption('cursorBlink', blink); this._xterm.setOption('cursorBlink', blink);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册