After running terminal.sendtext("some command"), how do I get the exit code of the command? If this is not possible, is there a way to run the command in external terminal(using something likechild_process.spawnSync()) and get the exit code?
You could use the new terminal exit api, see v1.71 Release Notes: terminal exit status api:
TerminalExitStatus.reason
Extension authors now have better insight into why a terminal exited via the new TerminalExitReason API.
export enum TerminalExitReason {
Unknown = 0,
Shutdown = 1,
Process = 2,
User = 3,
Extension = 4,
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With