emacs-devel
[Top][All Lists]
Advanced

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

Re: Sending EOF to process as part of comint-simple-send


From: Eli Zaretskii
Subject: Re: Sending EOF to process as part of comint-simple-send
Date: Sun, 15 Jan 2023 09:20:21 +0200

> Date: Sat, 14 Jan 2023 21:27:56 -0800
> From: Jim Porter <jporterbugs@gmail.com>
> 
> > So I think comint-simple-send should only send EOF if the
> > communications with the process are via a PTY, at least if the
> > sub-process is a real process (as opposed to a network or serial or
> > pipe process).  Or maybe we should only refrain from sending EOF on
> > MS-Windows?
> 
> I agree with this: I think we should only call 'process-send-eof' here 
> when communicating via PTY. (To be precise, whenever the process's 
> *stdin* is a PTY; as of Emacs 29, a process's stdin can be a PTY even if 
> its stdout isn't, or vice versa. See commit d7b89ea407.)

Yes, I know.  The function process-tty-name can be asked to return
information about a specific stream.

> I imagine you've looked into the relevant POSIX specs already, but just 
> to explain my reasoning for why I agree... my reading of the POSIX 
> spec[1] for EOF is that the code above is using it as a way to flush the 
> I/O buffer for the PTY, which makes sense to me:

Right.  This doesn't work for pipes, so I intend to introduce a new
function that does fsync on the descriptor via which we write to the
sub-process, and call it there instead of process-send-eof.  Does this
make sense?



reply via email to

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