Ensure negative exit codes are not used

Fixes #77250
This commit is contained in:
Daniel Imms
2019-07-11 15:47:15 -07:00
parent 59db5a5704
commit 5701770f87
2 changed files with 6 additions and 2 deletions

View File

@@ -788,7 +788,10 @@ class ExtHostVirtualProcess implements ITerminalChildProcess {
// Attach the real listeners
this._virtualProcess.onDidWrite(e => this._onProcessData.fire(e));
if (this._virtualProcess.onDidExit) {
this._virtualProcess.onDidExit(e => this._onProcessExit.fire(e));
this._virtualProcess.onDidExit(e => {
// Ensure only positive exit codes are returned
this._onProcessExit.fire(e >= 0 ? e : 1);
});
}
if (this._virtualProcess.onDidOverrideDimensions) {
this._virtualProcess.onDidOverrideDimensions(e => this._onProcessOverrideDimensions.fire(e ? { cols: e.columns, rows: e.rows } : e));