closeStdin method
Signals end-of-input on standard input (half-close).
Implementation
@override
Future<void> closeStdin() async {
// A pty has no half-close; deliver Ctrl-D so the line discipline signals
// end-of-input to the foreground program (mirrors the script PTY session).
writeStdin(const [0x04]);
}