emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sending EOF in process-send-string


From: Stefan Monnier
Subject: Sending EOF in process-send-string
Date: Tue, 01 Dec 2009 16:27:16 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Could someone explain to me exactly why

          /* If we sent just part of the string, put in an EOF (C-d)
             to force it through, before we send the rest.  */
          if (len > 0)
            Fprocess_send_eof (proc);

is the right thing to do in process.c:send_process ?

I have no knowledge of tty programming, but reading the tcsetattr
manpage, I get the impression that this EOF char only needs to be sent
if the tty is in ICANON mode (and even then, it's not necessary for
correctness, but only to make our text immediately `read'able to the
other end without having to wait for an EOL).  Apparently in ICANON
mode, this EOF char will not be passed on to the other end, so it seems
OK to send it.

OTOH, if the tty is in raw mode, the EOF char will be seen by the other
end, which is not what we want (and seems to be a cause of bugs in
inferior-process modes, worked around in various ways, typically with
something like "use a temp file is the input is too long").

A related question is: why does child_setup_tty set ICANON even though
the comments say "It should not echo or do line-editing, since that is done
in Emacs".


        Stefan "who's tempted to remove both the Fprocess_send_eof and
                the setting to ICANON"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]