mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-04-01 01:20:31 -04:00
Merge from vscode 011858832762aaff245b2336fb1c38166e7a10fb (#4663)
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ function getMockTheme(type: ThemeType): ITheme {
|
||||
selector: '',
|
||||
label: '',
|
||||
type: type,
|
||||
getColor: (colorId: ColorIdentifier) => themingRegistry.resolveDefaultColor(colorId, theme),
|
||||
getColor: (colorId: ColorIdentifier): Color | undefined => themingRegistry.resolveDefaultColor(colorId, theme),
|
||||
defines: () => true
|
||||
};
|
||||
return theme;
|
||||
|
||||
Reference in New Issue
Block a user