Repository navigation
fix: report a null exit code when the process is killed by a signal - #988
Open
shrmguy (leroyomey) wants to merge 1 commit into
Open
shrmguy (leroyomey) wants to merge 1 commit into
shrmguy (leroyomey) wants to merge 1 commit into
Conversation
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #461.
On Unix,
onExitreportedexitCode: 0when the process was terminated by a signal, which reads like a clean exit.child_processreportsnullin that case, and this change does the same.signalis unchanged.I used the signal reported by
waitpidrather than tracking whetherkill()was called, so a process that catches the signal and exits on its own still gets its real exit code.This widens the
exitCodetype tonumber | null, so TypeScript callers that assume a number will need a check. In VS Code that is one line interminalProcess.ts(this._exitCode = e.exitCode). If you'd rather not change the type in a minor release, tell me and I'll rework it.Tested on Ubuntu 24.04 with Node 24:
npm testpasses, and the two exit tests fail without the change inunixTerminal.ts. I haven't run it on macOS.