It now results in a literal ^D being seen by the subproces.
I vaguely recall seeing recently that emacs stopped using ICANON mode
for ptys; I presume this is the cause?
Yes.
It's been a long time since I did pty programming, but I seem to recall
that at least in some pty states, doing a zero-length write in the pty
master will send an end-of-file to the slave tty. I don't recall the
details though...
I really wish someone could help. At least if someone could point me to
some kind of documentation that would be very helpful. The best "doc"
I could find so far is the xterm source code, which I do not really
understand and whose behavior I haven't been able to reproduce yet
(e.g. it seems not to disable ICANON mode, and it doesn't seem to ever
send EOF either, even when sending large chunks of data, yet that data
doesn't get truncated, whereas when I try to to make Emacs send large
amounts of data in ICANON mode without EOFs, it gets truncated).