node-pty
node-pty copied to clipboard
Expose an onClose event on Terminal
In Node.js child_process module also provide close and exit events. There close means that all data were delivered and exit that the process exits. exit can happen before close, because child processes can use shared stdio streams: https://nodejs.org/api/child_process.html#child_process_event_close
Does it mean the same for node-pty? If not what would be the analogy instead?
The API only exposes onExit and onData events, that's probably why sometimes not all data gets flushed when using exit so it's probably a good idea to add an onClose event following these semantics. See here:
https://github.com/microsoft/node-pty/blob/f3099ad49177197203b27e9450aef7c03530c375/src/terminal.ts#L95-L98