onReply property
Function that is called when the terminal answers the program by itself: device attributes, status and cursor-position reports, colour and size queries, terminfo capabilities, focus reports, OSC 52 clipboard reads.
These bytes travel the same wire as user input and the program cannot tell them apart — but the embedder can, and sometimes must. An embedder that treats traffic on onOutput as "the user is typing" (to hand control back from a mirroring device, say) will otherwise be fooled the moment a full-screen program probes the terminal at startup.
Leave it null and replies go to onOutput, as they always have.
Implementation
void Function(String data)? onReply;