Skip to content

Commit

Permalink
Handle exit code undefined
Browse files Browse the repository at this point in the history
see microsoft/node-pty#751

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
  • Loading branch information
tsmaeder committed Dec 31, 2024
1 parent 9f326b5 commit 28b8c32
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/process/src/node/terminal-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ export class TerminalProcess extends Process {
// node-pty actually wait for the underlying streams to be closed before emitting exit.
// We should emulate the `exit` and `close` sequence.
terminal.onExit(({ exitCode, signal }) => {
// see https://github.com/microsoft/node-pty/issues/751
if (exitCode === undefined) {
exitCode = 0;
}
// Make sure to only pass either code or signal as !undefined, not
// both.
//
Expand Down

0 comments on commit 28b8c32

Please sign in to comment.