I think there is unique separate behaviour for the Pty.
- The system terminates if the last data is written
- The system terminates if the child exits (broken pipe?)
The code relies on the pipe existing long enough to send the data through, but the child exiting may cause the virtual channel to be deleted before the data is received.
This would be unique to Pty, and not exist for real terminal.