vscode: Terminal: add a way of getting the exit code
It would be great if each terminal object had an exitCode
property that will resolve to the actual exit code of the process. Something like this:
Terminal {
exitCode: Thenable<number>
}
It would be especially useful when running commands in the terminal dynamically from extensions, this way we could easily detect when the terminal exited and if it the command exited without errors.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 7
- Comments: 17 (14 by maintainers)
Commits related to this issue
- Support Terminal.exitStatus API Fixes #62103 — committed to microsoft/vscode by Tyriar 5 years ago
- Support Terminal.exitStatus API Fixes #62103 — committed to microsoft/vscode by Tyriar 5 years ago
This will be available for testing in the first 1.41 insiders (probably 1-2 days away), let me know how it goes. FYI @eamodio
Proposal:
I’m not sure we would want a Thenable on the API for this as that’s what
onDidCloseTerminal
is for. Maybe this?I’ll bring it up in an upcoming API meeting so I can open this up to PRs.
(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like: