Merge pull request #38132 from cleidigh/terminal-api-cwd/add

Add cwd to createTerminal via TerminalOptions for extension API  Addresses: #37709
This commit is contained in:
Daniel Imms
2017-12-15 09:44:26 -08:00
committed by GitHub
4 changed files with 13 additions and 4 deletions

View File

@@ -23,6 +23,7 @@ export class ExtHostTerminal implements vscode.Terminal {
name?: string,
shellPath?: string,
shellArgs?: string[],
cwd?: string,
env?: { [key: string]: string },
waitOnExit?: boolean
) {
@@ -32,7 +33,8 @@ export class ExtHostTerminal implements vscode.Terminal {
this._pidPromise = new Promise<number>(c => {
this._pidPromiseComplete = c;
});
this._proxy.$createTerminal(name, shellPath, shellArgs, env, waitOnExit).then((id) => {
this._proxy.$createTerminal(name, shellPath, shellArgs, cwd, env, waitOnExit).then((id) => {
this._id = id;
this._queuedRequests.forEach((r) => {
r.run(this._proxy, this._id);
@@ -113,7 +115,7 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
}
public createTerminalFromOptions(options: vscode.TerminalOptions): vscode.Terminal {
let terminal = new ExtHostTerminal(this._proxy, options.name, options.shellPath, options.shellArgs, options.env/*, options.waitOnExit*/);
let terminal = new ExtHostTerminal(this._proxy, options.name, options.shellPath, options.shellArgs, options.cwd, options.env /*, options.waitOnExit*/);
this._terminals.push(terminal);
return terminal;
}