Speed up lsof by avoiding unneeded work

Fixes #78438
This commit is contained in:
Daniel Imms
2019-10-26 08:53:44 -07:00
parent 334b636292
commit c7e72d7fde
@@ -260,7 +260,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess
return;
}
this._logService.trace('IPty#pid');
exec('lsof -p ' + this._ptyProcess.pid + ' | grep cwd', (error, stdout, stderr) => {
exec('lsof -OPl -p ' + this._ptyProcess.pid + ' | grep cwd', (error, stdout, stderr) => {
if (stdout !== '') {
resolve(stdout.substring(stdout.indexOf('/'), stdout.length - 1));
}