Skip to content

Commit

Permalink
Increase delay for activation of powershell terminals (#1537)
Browse files Browse the repository at this point in the history
Fixes #1533
  • Loading branch information
DonJayamanne authored Apr 27, 2018
1 parent 457cd66 commit 1386a16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions news/2 Fixes/1533.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Increase the delay for the activation of environments in Powershell terminals.
4 changes: 3 additions & 1 deletion src/client/common/terminal/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { inject, injectable } from 'inversify';
import { Disposable, Event, EventEmitter, Terminal, Uri } from 'vscode';
import { IServiceContainer } from '../../ioc/types';
import { ITerminalManager } from '../application/types';
import { sleep } from '../core.utils';
import { IDisposableRegistry } from '../types';
import { ITerminalHelper, ITerminalService, TerminalShellType } from './types';

Expand Down Expand Up @@ -67,7 +68,8 @@ export class TerminalService implements ITerminalService, Disposable {

// Give the command some time to complete.
// Its been observed that sending commands too early will strip some text off.
await new Promise(resolve => setTimeout(resolve, 500));
const delay = (this.terminalShellType === TerminalShellType.powershell || TerminalShellType.powershellCore) ? 1000 : 500;
await sleep(delay);
}
}

Expand Down

0 comments on commit 1386a16

Please sign in to comment.