Pass object instead of unwrapped args for term create

This commit is contained in:
Daniel Imms
2021-05-26 11:40:21 -07:00
parent 51a5caf3f2
commit 08cf3df745
2 changed files with 20 additions and 33 deletions

View File

@@ -3,9 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { withNullAsUndefined } from 'vs/base/common/types';
import { generateUuid } from 'vs/base/common/uuid';
import { TerminalLaunchConfig } from 'vs/workbench/api/common/extHost.protocol';
import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService';
import { BaseExtHostTerminalService, ExtHostTerminal, ITerminalInternalOptions } from 'vs/workbench/api/common/extHostTerminalService';
import type * as vscode from 'vscode';
@@ -25,22 +23,7 @@ export class ExtHostTerminalService extends BaseExtHostTerminalService {
public createTerminalFromOptions(options: vscode.TerminalOptions, internalOptions?: ITerminalInternalOptions): vscode.Terminal {
const terminal = new ExtHostTerminal(this._proxy, generateUuid(), options, options.name);
this._terminals.push(terminal);
// TODO: Pass in options instead of individual props
terminal.create(
withNullAsUndefined(options.shellPath),
withNullAsUndefined(options.shellArgs),
withNullAsUndefined(options.cwd),
withNullAsUndefined(options.env),
withNullAsUndefined(options.iconPath),
withNullAsUndefined(options.message),
/*options.waitOnExit*/ undefined,
withNullAsUndefined(options.strictEnv),
withNullAsUndefined(options.hideFromUser),
withNullAsUndefined(internalOptions?.isFeatureTerminal),
true,
withNullAsUndefined(internalOptions?.useShellEnvironment),
withNullAsUndefined(internalOptions?.isSplitTerminal)
);
terminal.create(options, internalOptions);
return terminal.value;
}
}