Merge from vscode 2b87545500dbc7899a493d69199aa4e061414ea0 (#5148)

This commit is contained in:
Anthony Dresser
2019-04-22 16:57:13 -07:00
committed by GitHub
parent 1b24dff738
commit 5e62229f25
15 changed files with 139 additions and 115 deletions

View File

@@ -260,7 +260,7 @@ configurationRegistry.registerConfiguration({
default: 'inherited'
},
'terminal.integrated.windowsEnableConpty': {
description: nls.localize('terminal.integrated.windowsEnableConpty', "Whether to use ConPTY for Windows terminal process communication (requires Windows 10 build number 18309+). Winpty will be used if this is false."),
description: nls.localize('terminal.integrated.windowsEnableConpty', "Whether to use ConPTY for Windows terminal process communication. Winpty will be used if this is false. Note that ConPTY will be disabled regardless of this setting when the Windows 10 build number is lower than 18309 or when you're running the 32-bit VS Code client under 64-bit Windows."),
type: 'boolean',
default: true
},

View File

@@ -443,6 +443,8 @@ export class TerminalInstance implements ITerminalInstance {
}
this._linkHandler = this._instantiationService.createInstance(TerminalLinkHandler, this._xterm, platform.platform, this._processManager);
});
} else if (this.shellLaunchConfig.isRendererOnly) {
this._linkHandler = this._instantiationService.createInstance(TerminalLinkHandler, this._xterm, undefined, undefined);
}
this._xterm.on('focus', () => this._onFocus.fire(this));
@@ -600,6 +602,9 @@ export class TerminalInstance implements ITerminalInstance {
});
}
});
} else if (this._shellLaunchConfig.isRendererOnly) {
this._widgetManager = new TerminalWidgetManager(this._wrapperElement);
this._linkHandler.setWidgetManager(this._widgetManager);
}
const computedStyle = window.getComputedStyle(this._container);

View File

@@ -74,8 +74,8 @@ export class TerminalLinkHandler {
constructor(
private _xterm: any,
private _platform: platform.Platform,
private readonly _processManager: ITerminalProcessManager,
private _platform: platform.Platform | undefined,
private readonly _processManager: ITerminalProcessManager | undefined,
@IOpenerService private readonly _openerService: IOpenerService,
@IEditorService private readonly _editorService: IEditorService,
@IConfigurationService private readonly _configurationService: IConfigurationService,
@@ -97,8 +97,10 @@ export class TerminalLinkHandler {
};
this.registerWebLinkHandler();
this.registerLocalLinkHandler();
this.registerGitDiffLinkHandlers();
if (this._platform) {
this.registerLocalLinkHandler();
this.registerGitDiffLinkHandlers();
}
}
public setWidgetManager(widgetManager: TerminalWidgetManager): void {
@@ -186,6 +188,9 @@ export class TerminalLinkHandler {
}
protected get _localLinkRegex(): RegExp {
if (!this._processManager) {
throw new Error('Process manager is required');
}
const baseLocalLinkClause = this._processManager.os === platform.OperatingSystem.Windows ? winLocalLinkClause : unixLocalLinkClause;
// Append line and column number regex
return new RegExp(`${baseLocalLinkClause}(${lineAndColumnClause})`);
@@ -246,6 +251,9 @@ export class TerminalLinkHandler {
}
private get osPath(): IPath {
if (!this._processManager) {
throw new Error('Process manager is required');
}
if (this._processManager.os === platform.OperatingSystem.Windows) {
return win32;
}
@@ -253,6 +261,9 @@ export class TerminalLinkHandler {
}
protected _preprocessPath(link: string): string | null {
if (!this._processManager) {
throw new Error('Process manager is required');
}
if (link.charAt(0) === '~') {
// Resolve ~ -> userHome
if (!this._processManager.userHome) {
@@ -283,6 +294,10 @@ export class TerminalLinkHandler {
}
private _resolvePath(link: string): PromiseLike<URI | null> {
if (!this._processManager) {
throw new Error('Process manager is required');
}
const preprocessedLink = this._preprocessPath(link);
if (!preprocessedLink) {
return Promise.resolve(null);