Very interesting, my naive assumption up to now had honestly been that ^D was just the shortcut for a NULL byte, 0x0 and everything just thus assumed it’d reached the end of the stream and finished up based on that.
Sending a special EOT 0x4 that gets special terminal and kernel handling feels just a little less… elegant… than what I had imagined.
I am curious now, would it be possibly to make a keyboard generate a NULL byte either by existing keyboard shortcut or custom hardware - and how the system would handle it? My guess would be that keyboards sending NULL might not be possible over keyboard protocol at all but I genuinely have no idea.