mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-22 08:09:42 +01:00
Start refactors to bring shell integration into pty host
Part of #143965
This commit is contained in:
@@ -263,7 +263,7 @@ export interface IPtyService extends IPtyHostController {
|
||||
unicodeVersion: '6' | '11',
|
||||
env: IProcessEnvironment,
|
||||
executableEnv: IProcessEnvironment,
|
||||
windowsEnableConpty: boolean,
|
||||
options: ITerminalProcessOptions,
|
||||
shouldPersist: boolean,
|
||||
workspaceId: string,
|
||||
workspaceName: string
|
||||
@@ -331,6 +331,7 @@ export interface ISerializedTerminalState {
|
||||
id: number;
|
||||
shellLaunchConfig: IShellLaunchConfig;
|
||||
processDetails: IProcessDetails;
|
||||
// TODO: "Options" is a bad name here, rename to not confuse with ITerminalProcessOptions
|
||||
processLaunchOptions: IPersistentTerminalProcessLaunchOptions;
|
||||
unicodeVersion: '6' | '11';
|
||||
replayEvent: IPtyHostProcessReplayEvent;
|
||||
@@ -340,7 +341,7 @@ export interface ISerializedTerminalState {
|
||||
export interface IPersistentTerminalProcessLaunchOptions {
|
||||
env: IProcessEnvironment;
|
||||
executableEnv: IProcessEnvironment;
|
||||
windowsEnableConpty: boolean;
|
||||
options: ITerminalProcessOptions;
|
||||
}
|
||||
|
||||
export interface IRequestResolveVariablesEvent {
|
||||
@@ -539,6 +540,18 @@ export interface IShellLaunchConfigDto {
|
||||
hideFromUser?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* A set of options for the terminal process. These differ from the shell launch config in that they
|
||||
* are set internally to the terminal component, not from the outside.
|
||||
*/
|
||||
export interface ITerminalProcessOptions {
|
||||
shellIntegration: {
|
||||
enabled: boolean;
|
||||
showWelcome: boolean;
|
||||
};
|
||||
windowsEnableConpty: boolean;
|
||||
}
|
||||
|
||||
export interface ITerminalEnvironment {
|
||||
[key: string]: string | null | undefined;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import { getResolvedShellEnv } from 'vs/platform/terminal/node/shellEnv';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { LogLevelChannelClient } from 'vs/platform/log/common/logIpc';
|
||||
import { RequestStore } from 'vs/platform/terminal/common/requestStore';
|
||||
import { HeartbeatConstants, IHeartbeatService, IProcessDataEvent, IPtyService, IReconnectConstants, IRequestResolveVariablesEvent, IShellLaunchConfig, ITerminalLaunchError, ITerminalProfile, ITerminalsLayoutInfo, TerminalIcon, TerminalIpcChannels, IProcessProperty, TitleEventSource, ProcessPropertyType, IProcessPropertyMap, TerminalSettingId, ISerializedTerminalState } from 'vs/platform/terminal/common/terminal';
|
||||
import { HeartbeatConstants, IHeartbeatService, IProcessDataEvent, IPtyService, IReconnectConstants, IRequestResolveVariablesEvent, IShellLaunchConfig, ITerminalLaunchError, ITerminalProfile, ITerminalsLayoutInfo, TerminalIcon, TerminalIpcChannels, IProcessProperty, TitleEventSource, ProcessPropertyType, IProcessPropertyMap, TerminalSettingId, ISerializedTerminalState, ITerminalProcessOptions } from 'vs/platform/terminal/common/terminal';
|
||||
import { registerTerminalPlatformConfiguration } from 'vs/platform/terminal/common/terminalPlatformConfiguration';
|
||||
import { IGetTerminalLayoutInfoArgs, IProcessDetails, IPtyHostProcessReplayEvent, ISetTerminalLayoutInfoArgs } from 'vs/platform/terminal/common/terminalProcess';
|
||||
import { detectAvailableProfiles } from 'vs/platform/terminal/node/terminalProfiles';
|
||||
@@ -201,9 +201,21 @@ export class PtyHostService extends Disposable implements IPtyService {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
async createProcess(shellLaunchConfig: IShellLaunchConfig, cwd: string, cols: number, rows: number, unicodeVersion: '6' | '11', env: IProcessEnvironment, executableEnv: IProcessEnvironment, windowsEnableConpty: boolean, shouldPersist: boolean, workspaceId: string, workspaceName: string): Promise<number> {
|
||||
async createProcess(
|
||||
shellLaunchConfig: IShellLaunchConfig,
|
||||
cwd: string,
|
||||
cols: number,
|
||||
rows: number,
|
||||
unicodeVersion: '6' | '11',
|
||||
env: IProcessEnvironment,
|
||||
executableEnv: IProcessEnvironment,
|
||||
options: ITerminalProcessOptions,
|
||||
shouldPersist: boolean,
|
||||
workspaceId: string,
|
||||
workspaceName: string
|
||||
): Promise<number> {
|
||||
const timeout = setTimeout(() => this._handleUnresponsiveCreateProcess(), HeartbeatConstants.CreateProcessTimeout);
|
||||
const id = await this._proxy.createProcess(shellLaunchConfig, cwd, cols, rows, unicodeVersion, env, executableEnv, windowsEnableConpty, shouldPersist, workspaceId, workspaceName);
|
||||
const id = await this._proxy.createProcess(shellLaunchConfig, cwd, cols, rows, unicodeVersion, env, executableEnv, options, shouldPersist, workspaceId, workspaceName);
|
||||
clearTimeout(timeout);
|
||||
lastPtyId = Math.max(lastPtyId, id);
|
||||
return id;
|
||||
|
||||
@@ -12,7 +12,7 @@ import { URI } from 'vs/base/common/uri';
|
||||
import { getSystemShell } from 'vs/base/node/shell';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { RequestStore } from 'vs/platform/terminal/common/requestStore';
|
||||
import { IProcessDataEvent, IProcessReadyEvent, IPtyService, IRawTerminalInstanceLayoutInfo, IReconnectConstants, IRequestResolveVariablesEvent, IShellLaunchConfig, ITerminalInstanceLayoutInfoById, ITerminalLaunchError, ITerminalsLayoutInfo, ITerminalTabLayoutInfoById, TerminalIcon, IProcessProperty, TitleEventSource, ProcessPropertyType, IProcessPropertyMap, IFixedTerminalDimensions, IPersistentTerminalProcessLaunchOptions, ICrossVersionSerializedTerminalState, ISerializedTerminalState } from 'vs/platform/terminal/common/terminal';
|
||||
import { IProcessDataEvent, IProcessReadyEvent, IPtyService, IRawTerminalInstanceLayoutInfo, IReconnectConstants, IRequestResolveVariablesEvent, IShellLaunchConfig, ITerminalInstanceLayoutInfoById, ITerminalLaunchError, ITerminalsLayoutInfo, ITerminalTabLayoutInfoById, TerminalIcon, IProcessProperty, TitleEventSource, ProcessPropertyType, IProcessPropertyMap, IFixedTerminalDimensions, IPersistentTerminalProcessLaunchOptions, ICrossVersionSerializedTerminalState, ISerializedTerminalState, ITerminalProcessOptions } from 'vs/platform/terminal/common/terminal';
|
||||
import { TerminalDataBufferer } from 'vs/platform/terminal/common/terminalDataBuffering';
|
||||
import { escapeNonWindowsPath } from 'vs/platform/terminal/common/terminalEnvironment';
|
||||
import { Terminal as XtermTerminal } from 'xterm-headless';
|
||||
@@ -146,7 +146,7 @@ export class PtyService extends Disposable implements IPtyService {
|
||||
terminal.unicodeVersion,
|
||||
terminal.processLaunchOptions.env,
|
||||
terminal.processLaunchOptions.executableEnv,
|
||||
terminal.processLaunchOptions.windowsEnableConpty,
|
||||
terminal.processLaunchOptions.options,
|
||||
true,
|
||||
terminal.processDetails.workspaceId,
|
||||
terminal.processDetails.workspaceName,
|
||||
@@ -169,7 +169,7 @@ export class PtyService extends Disposable implements IPtyService {
|
||||
unicodeVersion: '6' | '11',
|
||||
env: IProcessEnvironment,
|
||||
executableEnv: IProcessEnvironment,
|
||||
windowsEnableConpty: boolean,
|
||||
options: ITerminalProcessOptions,
|
||||
shouldPersist: boolean,
|
||||
workspaceId: string,
|
||||
workspaceName: string,
|
||||
@@ -179,12 +179,12 @@ export class PtyService extends Disposable implements IPtyService {
|
||||
throw new Error('Attempt to create a process when attach object was provided');
|
||||
}
|
||||
const id = ++this._lastPtyId;
|
||||
const process = new TerminalProcess(shellLaunchConfig, cwd, cols, rows, env, executableEnv, windowsEnableConpty, this._logService);
|
||||
const process = new TerminalProcess(shellLaunchConfig, cwd, cols, rows, env, executableEnv, options, this._logService);
|
||||
process.onProcessData(event => this._onProcessData.fire({ id, event }));
|
||||
const processLaunchOptions: IPersistentTerminalProcessLaunchOptions = {
|
||||
env,
|
||||
executableEnv,
|
||||
windowsEnableConpty
|
||||
options
|
||||
};
|
||||
const persistentProcess = new PersistentTerminalProcess(id, process, workspaceId, workspaceName, shouldPersist, cols, rows, processLaunchOptions, unicodeVersion, this._reconnectConstants, this._logService, isReviving ? shellLaunchConfig.initialText : undefined, shellLaunchConfig.icon, shellLaunchConfig.color, shellLaunchConfig.name, shellLaunchConfig.fixedDimensions);
|
||||
process.onDidChangeProperty(property => this._onDidChangeProperty.fire({ id, property }));
|
||||
|
||||
@@ -10,6 +10,7 @@ import { IProcessEnvironment, isWindows } from 'vs/base/common/platform';
|
||||
import * as process from 'vs/base/common/process';
|
||||
import { isString } from 'vs/base/common/types';
|
||||
import * as pfs from 'vs/base/node/pfs';
|
||||
import { IShellLaunchConfig, ITerminalProcessOptions } from 'vs/platform/terminal/common/terminal';
|
||||
|
||||
export function getWindowsBuildNumber(): number {
|
||||
const osVersion = (/(\d+)\.(\d+)\.(\d+)/g).exec(os.release());
|
||||
@@ -72,3 +73,34 @@ export async function findExecutable(command: string, cwd?: string, paths?: stri
|
||||
const fullPath = path.join(cwd, command);
|
||||
return await exists(fullPath) ? fullPath : undefined;
|
||||
}
|
||||
|
||||
export interface IShellIntegrationInjection {
|
||||
/**
|
||||
* A new set of arguments to use.
|
||||
*/
|
||||
newArgs: string[] | undefined;
|
||||
/**
|
||||
* An optional environment to mixing to the real environment.
|
||||
*/
|
||||
envMixin?: IProcessEnvironment;
|
||||
/**
|
||||
* An optional array of files to copy from `source` to `dest`.
|
||||
*/
|
||||
copyFiles?: {
|
||||
source: string;
|
||||
dest: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given shell launch config, returns arguments to replace and an optional environment to
|
||||
* mixin to the SLC's environment to enable shell integration. This must be run within the context
|
||||
* that creates the process to ensure accuracy. Returns undefined if shell integration cannot be
|
||||
* enabled.
|
||||
*/
|
||||
export function getShellIntegrationInjection(
|
||||
shellLaunchConfig: IShellLaunchConfig,
|
||||
options: ITerminalProcessOptions['shellIntegration']
|
||||
): IShellIntegrationInjection | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@ import { URI } from 'vs/base/common/uri';
|
||||
import { Promises } from 'vs/base/node/pfs';
|
||||
import { localize } from 'vs/nls';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { FlowControlConstants, IShellLaunchConfig, ITerminalChildProcess, ITerminalLaunchError, IProcessProperty, IProcessPropertyMap as IProcessPropertyMap, ProcessPropertyType, TerminalShellType, IProcessReadyEvent } from 'vs/platform/terminal/common/terminal';
|
||||
import { FlowControlConstants, IShellLaunchConfig, ITerminalChildProcess, ITerminalLaunchError, IProcessProperty, IProcessPropertyMap as IProcessPropertyMap, ProcessPropertyType, TerminalShellType, IProcessReadyEvent, ITerminalProcessOptions } from 'vs/platform/terminal/common/terminal';
|
||||
import { ChildProcessMonitor } from 'vs/platform/terminal/node/childProcessMonitor';
|
||||
import { findExecutable, getWindowsBuildNumber } from 'vs/platform/terminal/node/terminalEnvironment';
|
||||
import { findExecutable, getShellIntegrationInjection, getWindowsBuildNumber } from 'vs/platform/terminal/node/terminalEnvironment';
|
||||
import { WindowsShellHelper } from 'vs/platform/terminal/node/windowsShellHelper';
|
||||
|
||||
const enum ShutdownConstants {
|
||||
@@ -132,7 +132,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess
|
||||
* environment used for `findExecutable`
|
||||
*/
|
||||
private readonly _executableEnv: IProcessEnvironment,
|
||||
windowsEnableConpty: boolean,
|
||||
private readonly _options: ITerminalProcessOptions,
|
||||
@ILogService private readonly _logService: ILogService
|
||||
) {
|
||||
super();
|
||||
@@ -147,7 +147,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess
|
||||
this._initialCwd = cwd;
|
||||
this._properties[ProcessPropertyType.InitialCwd] = this._initialCwd;
|
||||
this._properties[ProcessPropertyType.Cwd] = this._initialCwd;
|
||||
const useConpty = windowsEnableConpty && process.platform === 'win32' && getWindowsBuildNumber() >= 18309;
|
||||
const useConpty = this._options.windowsEnableConpty && process.platform === 'win32' && getWindowsBuildNumber() >= 18309;
|
||||
this._ptyOptions = {
|
||||
name,
|
||||
cwd,
|
||||
@@ -187,6 +187,13 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess
|
||||
return firstError;
|
||||
}
|
||||
|
||||
this._logService.info('options', this._options);
|
||||
if (this._options.shellIntegration) {
|
||||
// TODO: Do injection here
|
||||
const injection = getShellIntegrationInjection(this.shellLaunchConfig, this._options.shellIntegration);
|
||||
this._logService.info('injection', injection);
|
||||
}
|
||||
|
||||
// Handle zsh shell integration - Set $ZDOTDIR to a temp dir and create $ZDOTDIR/.zshrc
|
||||
if (this.shellLaunchConfig.env?.['_ZDOTDIR'] === '1') {
|
||||
const zdotdir = path.join(tmpdir(), 'vscode-zsh');
|
||||
|
||||
@@ -236,7 +236,7 @@ export class RemoteTerminalChannel extends Disposable implements IServerChannel<
|
||||
};
|
||||
const cliServer = new CLIServerBase(commandsExecuter, this._logService, ipcHandlePath);
|
||||
|
||||
const id = await this._ptyService.createProcess(shellLaunchConfig, initialCwd, args.cols, args.rows, args.unicodeVersion, env, baseEnv, false, args.shouldPersistTerminal, args.workspaceId, args.workspaceName);
|
||||
const id = await this._ptyService.createProcess(shellLaunchConfig, initialCwd, args.cols, args.rows, args.unicodeVersion, env, baseEnv, args.options, args.shouldPersistTerminal, args.workspaceId, args.workspaceName);
|
||||
this._ptyService.onProcessExit(e => e.id === id && cliServer.dispose());
|
||||
|
||||
return {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remoteAuthorityResolver';
|
||||
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
|
||||
import { IShellLaunchConfig, IShellLaunchConfigDto, ITerminalChildProcess, ITerminalEnvironment, ITerminalProfile, ITerminalsLayoutInfo, ITerminalsLayoutInfoById, ProcessPropertyType, TerminalIcon, TerminalSettingId, TitleEventSource } from 'vs/platform/terminal/common/terminal';
|
||||
import { IShellLaunchConfig, IShellLaunchConfigDto, ITerminalChildProcess, ITerminalEnvironment, ITerminalProcessOptions, ITerminalProfile, ITerminalsLayoutInfo, ITerminalsLayoutInfoById, ProcessPropertyType, TerminalIcon, TerminalSettingId, TitleEventSource } from 'vs/platform/terminal/common/terminal';
|
||||
import { IProcessDetails } from 'vs/platform/terminal/common/terminalProcess';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
||||
@@ -159,7 +159,7 @@ class RemoteTerminalBackend extends BaseTerminalBackend implements ITerminalBack
|
||||
rows: number,
|
||||
unicodeVersion: '6' | '11',
|
||||
env: IProcessEnvironment, // TODO: This is ignored
|
||||
windowsEnableConpty: boolean, // TODO: This is ignored
|
||||
options: ITerminalProcessOptions,
|
||||
shouldPersist: boolean
|
||||
): Promise<ITerminalChildProcess> {
|
||||
if (!this._remoteTerminalChannel) {
|
||||
@@ -205,6 +205,7 @@ class RemoteTerminalBackend extends BaseTerminalBackend implements ITerminalBack
|
||||
shellLaunchConfigDto,
|
||||
configuration,
|
||||
activeWorkspaceRootUri,
|
||||
options,
|
||||
shouldPersist,
|
||||
cols,
|
||||
rows,
|
||||
|
||||
@@ -21,7 +21,7 @@ import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
import { EnvironmentVariableInfoChangesActive, EnvironmentVariableInfoStale } from 'vs/workbench/contrib/terminal/browser/environmentVariableInfo';
|
||||
import { IPathService } from 'vs/workbench/services/path/common/pathService';
|
||||
import { IEnvironmentVariableInfo, IEnvironmentVariableService, IMergedEnvironmentVariableCollection } from 'vs/workbench/contrib/terminal/common/environmentVariable';
|
||||
import { IProcessDataEvent, IShellLaunchConfig, ITerminalChildProcess, ITerminalEnvironment, ITerminalLaunchError, FlowControlConstants, ITerminalDimensions, IProcessReadyEvent, IProcessProperty, ProcessPropertyType, IProcessPropertyMap } from 'vs/platform/terminal/common/terminal';
|
||||
import { IProcessDataEvent, IShellLaunchConfig, ITerminalChildProcess, ITerminalEnvironment, ITerminalLaunchError, FlowControlConstants, ITerminalDimensions, IProcessReadyEvent, IProcessProperty, ProcessPropertyType, IProcessPropertyMap, ITerminalProcessOptions, TerminalSettingId } from 'vs/platform/terminal/common/terminal';
|
||||
import { TerminalRecorder } from 'vs/platform/terminal/common/terminalRecorder';
|
||||
import { localize } from 'vs/nls';
|
||||
import { formatMessageForTerminal } from 'vs/workbench/contrib/terminal/common/terminalStrings';
|
||||
@@ -281,6 +281,14 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
|
||||
shellLaunchConfig.env['_ZDOTDIR'] = '1';
|
||||
}
|
||||
|
||||
const options: ITerminalProcessOptions = {
|
||||
shellIntegration: {
|
||||
enabled: this._configurationService.getValue(TerminalSettingId.ShellIntegrationEnabled),
|
||||
showWelcome: this._configurationService.getValue(TerminalSettingId.ShellIntegrationShowWelcome),
|
||||
},
|
||||
windowsEnableConpty: this._configHelper.config.windowsEnableConpty && !isScreenReaderModeEnabled
|
||||
};
|
||||
|
||||
newProcess = await backend.createProcess(
|
||||
shellLaunchConfig,
|
||||
'', // TODO: Fix cwd
|
||||
@@ -288,7 +296,7 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
|
||||
rows,
|
||||
this._configHelper.config.unicodeVersion,
|
||||
env, // TODO:
|
||||
true, // TODO: Fix enable
|
||||
options,
|
||||
shouldPersist
|
||||
);
|
||||
} catch (e) {
|
||||
@@ -469,9 +477,15 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
|
||||
});
|
||||
}
|
||||
this.shellIntegrationAttempted = shellIntegration.enableShellIntegration;
|
||||
const useConpty = this._configHelper.config.windowsEnableConpty && !isScreenReaderModeEnabled;
|
||||
const options: ITerminalProcessOptions = {
|
||||
shellIntegration: {
|
||||
enabled: this._configurationService.getValue(TerminalSettingId.ShellIntegrationEnabled),
|
||||
showWelcome: this._configurationService.getValue(TerminalSettingId.ShellIntegrationShowWelcome),
|
||||
},
|
||||
windowsEnableConpty: this._configHelper.config.windowsEnableConpty && !isScreenReaderModeEnabled
|
||||
};
|
||||
const shouldPersist = this._configHelper.config.enablePersistentSessions && !shellLaunchConfig.isFeatureTerminal;
|
||||
return await backend.createProcess(shellLaunchConfig, initialCwd, cols, rows, this._configHelper.config.unicodeVersion, env, useConpty, shouldPersist);
|
||||
return await backend.createProcess(shellLaunchConfig, initialCwd, cols, rows, this._configHelper.config.unicodeVersion, env, options, shouldPersist);
|
||||
}
|
||||
|
||||
private _setupPtyHostListeners(backend: ITerminalBackend) {
|
||||
|
||||
@@ -18,7 +18,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { IEnvironmentVariableService, ISerializableEnvironmentVariableCollection } from 'vs/workbench/contrib/terminal/common/environmentVariable';
|
||||
import { IProcessDataEvent, IRequestResolveVariablesEvent, IShellLaunchConfigDto, ITerminalLaunchError, ITerminalProfile, ITerminalsLayoutInfo, ITerminalsLayoutInfoById, TerminalIcon, IProcessProperty, ProcessPropertyType, IProcessPropertyMap, TitleEventSource, ISerializedTerminalState, IPtyHostController } from 'vs/platform/terminal/common/terminal';
|
||||
import { IProcessDataEvent, IRequestResolveVariablesEvent, IShellLaunchConfigDto, ITerminalLaunchError, ITerminalProfile, ITerminalsLayoutInfo, ITerminalsLayoutInfoById, TerminalIcon, IProcessProperty, ProcessPropertyType, IProcessPropertyMap, TitleEventSource, ISerializedTerminalState, IPtyHostController, ITerminalProcessOptions } from 'vs/platform/terminal/common/terminal';
|
||||
import { IGetTerminalLayoutInfoArgs, IProcessDetails, IPtyHostProcessReplayEvent, ISetTerminalLayoutInfoArgs } from 'vs/platform/terminal/common/terminalProcess';
|
||||
import { IProcessEnvironment, OperatingSystem } from 'vs/base/common/platform';
|
||||
import { ICompleteTerminalConfiguration } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
@@ -44,6 +44,7 @@ export interface ICreateTerminalProcessArguments {
|
||||
activeWorkspaceFolder: IWorkspaceFolderData | null;
|
||||
activeFileResource: UriComponents | undefined;
|
||||
shouldPersistTerminal: boolean;
|
||||
options: ITerminalProcessOptions;
|
||||
cols: number;
|
||||
rows: number;
|
||||
unicodeVersion: '6' | '11';
|
||||
@@ -114,7 +115,16 @@ export class RemoteTerminalChannelClient implements IPtyHostController {
|
||||
return this._channel.call('$restartPtyHost', []);
|
||||
}
|
||||
|
||||
async createProcess(shellLaunchConfig: IShellLaunchConfigDto, configuration: ICompleteTerminalConfiguration, activeWorkspaceRootUri: URI | undefined, shouldPersistTerminal: boolean, cols: number, rows: number, unicodeVersion: '6' | '11'): Promise<ICreateTerminalProcessResult> {
|
||||
async createProcess(
|
||||
shellLaunchConfig: IShellLaunchConfigDto,
|
||||
configuration: ICompleteTerminalConfiguration,
|
||||
activeWorkspaceRootUri: URI | undefined,
|
||||
options: ITerminalProcessOptions,
|
||||
shouldPersistTerminal: boolean,
|
||||
cols: number,
|
||||
rows: number,
|
||||
unicodeVersion: '6' | '11'
|
||||
): Promise<ICreateTerminalProcessResult> {
|
||||
// Be sure to first wait for the remote configuration
|
||||
await this._configurationService.whenRemoteConfigurationLoaded();
|
||||
|
||||
@@ -167,6 +177,7 @@ export class RemoteTerminalChannelClient implements IPtyHostController {
|
||||
activeWorkspaceFolder,
|
||||
activeFileResource,
|
||||
shouldPersistTerminal,
|
||||
options,
|
||||
cols,
|
||||
rows,
|
||||
unicodeVersion,
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Event } from 'vs/base/common/event';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IProcessEnvironment, OperatingSystem } from 'vs/base/common/platform';
|
||||
import { IExtensionPointDescriptor } from 'vs/workbench/services/extensions/common/extensionsRegistry';
|
||||
import { IProcessDataEvent, IProcessReadyEvent, IShellLaunchConfig, ITerminalChildProcess, ITerminalLaunchError, ITerminalProfile, ITerminalProfileObject, ITerminalsLayoutInfo, ITerminalsLayoutInfoById, TerminalIcon, TerminalLocationString, IProcessProperty, TitleEventSource, ProcessPropertyType, IFixedTerminalDimensions, IExtensionTerminalProfile, ICreateContributedTerminalProfileOptions, IProcessPropertyMap, ITerminalEnvironment } from 'vs/platform/terminal/common/terminal';
|
||||
import { IProcessDataEvent, IProcessReadyEvent, IShellLaunchConfig, ITerminalChildProcess, ITerminalLaunchError, ITerminalProfile, ITerminalProfileObject, ITerminalsLayoutInfo, ITerminalsLayoutInfoById, TerminalIcon, TerminalLocationString, IProcessProperty, TitleEventSource, ProcessPropertyType, IFixedTerminalDimensions, IExtensionTerminalProfile, ICreateContributedTerminalProfileOptions, IProcessPropertyMap, ITerminalEnvironment, ITerminalProcessOptions } from 'vs/platform/terminal/common/terminal';
|
||||
import { IEnvironmentVariableInfo } from 'vs/workbench/contrib/terminal/common/environmentVariable';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
@@ -138,7 +138,7 @@ export interface ITerminalBackend {
|
||||
rows: number,
|
||||
unicodeVersion: '6' | '11',
|
||||
env: IProcessEnvironment,
|
||||
windowsEnableConpty: boolean,
|
||||
options: ITerminalProcessOptions,
|
||||
shouldPersist: boolean
|
||||
): Promise<ITerminalChildProcess>;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
|
||||
import { IProcessPropertyMap, IShellLaunchConfig, ITerminalChildProcess, ITerminalEnvironment, ITerminalsLayoutInfo, ITerminalsLayoutInfoById, ProcessPropertyType, TerminalSettingId, TitleEventSource } from 'vs/platform/terminal/common/terminal';
|
||||
import { IProcessPropertyMap, IShellLaunchConfig, ITerminalChildProcess, ITerminalEnvironment, ITerminalProcessOptions, ITerminalsLayoutInfo, ITerminalsLayoutInfoById, ProcessPropertyType, TerminalSettingId, TitleEventSource } from 'vs/platform/terminal/common/terminal';
|
||||
import { IGetTerminalLayoutInfoArgs, IProcessDetails, ISetTerminalLayoutInfoArgs } from 'vs/platform/terminal/common/terminalProcess';
|
||||
import { ILocalPtyService } from 'vs/platform/terminal/electron-sandbox/terminal';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
@@ -146,11 +146,11 @@ class LocalTerminalBackend extends BaseTerminalBackend implements ITerminalBacke
|
||||
rows: number,
|
||||
unicodeVersion: '6' | '11',
|
||||
env: IProcessEnvironment,
|
||||
windowsEnableConpty: boolean,
|
||||
options: ITerminalProcessOptions,
|
||||
shouldPersist: boolean
|
||||
): Promise<ITerminalChildProcess> {
|
||||
const executableEnv = await this._shellEnvironmentService.getShellEnv();
|
||||
const id = await this._localPtyService.createProcess(shellLaunchConfig, cwd, cols, rows, unicodeVersion, env, executableEnv, windowsEnableConpty, shouldPersist, this._getWorkspaceId(), this._getWorkspaceName());
|
||||
const id = await this._localPtyService.createProcess(shellLaunchConfig, cwd, cols, rows, unicodeVersion, env, executableEnv, options, shouldPersist, this._getWorkspaceId(), this._getWorkspaceName());
|
||||
const pty = this._instantiationService.createInstance(LocalPty, id, shouldPersist);
|
||||
this._ptys.set(id, pty);
|
||||
return pty;
|
||||
|
||||
Reference in New Issue
Block a user