Merge from vscode 011858832762aaff245b2336fb1c38166e7a10fb (#4663)

This commit is contained in:
Anthony Dresser
2019-03-22 13:07:54 -07:00
committed by GitHub
parent f5c9174c2f
commit 4a87a24235
296 changed files with 2531 additions and 2472 deletions

View File

@@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';

View File

@@ -34,6 +34,7 @@ import { IHistoryService } from 'vs/workbench/services/history/common/history';
import { Schemas } from 'vs/base/common/network';
import { URI } from 'vs/base/common/uri';
import { isWindows } from 'vs/base/common/platform';
import { withNullAsUndefined } from 'vs/base/common/types';
export const TERMINAL_PICKER_PREFIX = 'term ';
@@ -291,7 +292,7 @@ export class SendSequenceTerminalCommand extends Command {
const workspaceContextService = accessor.get(IWorkspaceContextService);
const historyService = accessor.get(IHistoryService);
const activeWorkspaceRootUri = historyService.getLastActiveWorkspaceRoot(Schemas.file);
const lastActiveWorkspaceRoot = activeWorkspaceRootUri ? workspaceContextService.getWorkspaceFolder(activeWorkspaceRootUri) || undefined : undefined;
const lastActiveWorkspaceRoot = activeWorkspaceRootUri ? withNullAsUndefined(workspaceContextService.getWorkspaceFolder(activeWorkspaceRootUri)) : undefined;
const resolvedText = configurationResolverService.resolve(lastActiveWorkspaceRoot, args.text);
terminalInstance.sendText(resolvedText, false);
}

View File

@@ -894,9 +894,12 @@ export class TerminalInstance implements ITerminalInstance {
if (platform.isWindows) {
this._processManager.ptyProcessReady.then(() => {
if (this._processManager!.remoteAuthority) {
return;
}
this._xtermReadyPromise.then(() => {
if (!this._isDisposed) {
this._terminalInstanceService.createWindowsShellHelper(this._processManager!.shellProcessId, this, this._xterm);
this._windowsShellHelper = this._terminalInstanceService.createWindowsShellHelper(this._processManager!.shellProcessId, this, this._xterm);
}
});
});

View File

@@ -161,7 +161,7 @@ export class TerminalPanel extends Panel {
return this._contextMenuActions;
}
public getActionItem(action: Action): IActionItem | null {
public getActionItem(action: Action): IActionItem | undefined {
if (action.id === SwitchTerminalAction.ID) {
return this._instantiationService.createInstance(SwitchTerminalActionItem, action);
}

View File

@@ -22,7 +22,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
import { IProductService } from 'vs/platform/product/common/product';
import { ITerminalInstanceService } from 'vs/workbench/contrib/terminal/browser/terminal';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IRemoteEnvironmentService } from 'vs/workbench/services/remote/common/remoteEnvironmentService';
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
/** The amount of time to consider terminal errors to be related to the launch */
const LAUNCHING_DURATION = 500;
@@ -77,7 +77,7 @@ export class TerminalProcessManager implements ITerminalProcessManager {
@IEnvironmentService private readonly _environmentService: IEnvironmentService,
@IProductService private readonly _productService: IProductService,
@ITerminalInstanceService private readonly _terminalInstanceService: ITerminalInstanceService,
@IRemoteEnvironmentService private readonly _remoteEnvironmentService: IRemoteEnvironmentService
@IRemoteAgentService private readonly _remoteAgentService: IRemoteAgentService
) {
this.ptyProcessReady = new Promise<void>(c => {
this.onProcessReady(() => {
@@ -123,7 +123,7 @@ export class TerminalProcessManager implements ITerminalProcessManager {
this.os = platform.OS;
if (launchRemotely) {
if (hasRemoteAuthority) {
this._remoteEnvironmentService.remoteEnvironment.then(env => {
this._remoteAgentService.getEnvironment().then(env => {
if (!env) {
return;
}
@@ -250,6 +250,7 @@ export class TerminalProcessManager implements ITerminalProcessManager {
}
public async getLatency(): Promise<number> {
await this.ptyProcessReady;
if (!this._process) {
return Promise.resolve(0);
}