Merge from vscode 718331d6f3ebd1b571530ab499edb266ddd493d5

This commit is contained in:
ADS Merger
2020-02-08 04:50:58 +00:00
parent 8c61538a27
commit 2af13c18d2
752 changed files with 16458 additions and 10063 deletions

View File

@@ -35,6 +35,7 @@ import { ITerminalInstanceService, ITerminalInstance, TerminalShellType } from '
import { TerminalProcessManager } from 'vs/workbench/contrib/terminal/browser/terminalProcessManager';
import { Terminal as XTermTerminal, IBuffer, ITerminalAddon } from 'xterm';
import { SearchAddon, ISearchOptions } from 'xterm-addon-search';
import { Unicode11Addon } from 'xterm-addon-unicode11';
import { CommandTrackerAddon } from 'vs/workbench/contrib/terminal/browser/addons/commandTrackerAddon';
import { NavigationModeAddon } from 'vs/workbench/contrib/terminal/browser/addons/navigationModeAddon';
import { XTermCore } from 'vs/workbench/contrib/terminal/browser/xterm-private';
@@ -148,7 +149,9 @@ export const DEFAULT_COMMANDS_TO_SKIP_SHELL: string[] = [
'workbench.action.openNextRecentlyUsedEditorInGroup',
'workbench.action.openPreviousRecentlyUsedEditorInGroup',
'workbench.action.quickOpenPreviousRecentlyUsedEditor',
'workbench.action.quickOpenLeastRecentlyUsedEditor',
'workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup',
'workbench.action.quickOpenLeastRecentlyUsedEditorInGroup',
'workbench.action.focusActiveEditorGroup',
'workbench.action.focusFirstEditorGroup',
'workbench.action.focusLastEditorGroup',
@@ -198,6 +201,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
private _xterm: XTermTerminal | undefined;
private _xtermCore: XTermCore | undefined;
private _xtermSearch: SearchAddon | undefined;
private _xtermUnicode11: Unicode11Addon | undefined;
private _xtermElement: HTMLDivElement | undefined;
private _terminalHasTextContextKey: IContextKey<boolean>;
private _terminalA11yTreeFocusContextKey: IContextKey<boolean>;
@@ -326,6 +330,9 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
// supported.
this.setVisible(this._isVisible);
}
if (e.affectsConfiguration('terminal.integrated.unicodeVersion')) {
this._updateUnicodeVersion();
}
if (e.affectsConfiguration('editor.accessibilitySupport')) {
this.updateAccessibilitySupport();
}
@@ -482,6 +489,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
});
this._xterm = xterm;
this._xtermCore = (xterm as any)._core as XTermCore;
this._updateUnicodeVersion();
this.updateAccessibilitySupport();
this._terminalInstanceService.getXtermSearchConstructor().then(Addon => {
this._xtermSearch = new Addon();
@@ -509,7 +517,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
// Force line data to be sent when the cursor is moved, the main purpose for
// this is because ConPTY will often not do a line feed but instead move the
// cursor, in which case we still want to send the current line's data to tasks.
xterm.parser.addCsiHandler({ final: 'H' }, () => {
xterm.parser.registerCsiHandler({ final: 'H' }, () => {
this._onCursorMove();
return false;
});
@@ -793,9 +801,12 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
dispose(this._windowsShellHelper);
this._windowsShellHelper = undefined;
this._linkHandler = dispose(this._linkHandler);
this._commandTrackerAddon = dispose(this._commandTrackerAddon);
this._widgetManager = dispose(this._widgetManager);
dispose(this._linkHandler);
this._linkHandler = undefined;
dispose(this._commandTrackerAddon);
this._commandTrackerAddon = undefined;
dispose(this._widgetManager);
this._widgetManager = undefined;
if (this._xterm && this._xterm.element) {
this._hadFocusOnExit = dom.hasClass(this._xterm.element, 'focus');
@@ -1237,6 +1248,18 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
}
}
private async _updateUnicodeVersion(): Promise<void> {
if (!this._xterm) {
throw new Error('Cannot update unicode version before xterm has been initialized');
}
if (!this._xtermUnicode11 && this._configHelper.config.unicodeVersion === '11') {
const Addon = await this._terminalInstanceService.getXtermUnicode11Constructor();
this._xtermUnicode11 = new Addon();
this._xterm.loadAddon(this._xtermUnicode11);
}
this._xterm.unicode.activeVersion = this._configHelper.config.unicodeVersion;
}
public updateAccessibilitySupport(): void {
const isEnabled = this._accessibilityService.isScreenReaderOptimized();
if (isEnabled) {