Filipp Gunbin writes: > Thomas, > > On 26/10/2018 11:41 -0400, Thomas Fitzsimmons wrote: > >> One worry I have about always leaving process-connection-type t is >> that, depending on the external system state -- specifically whether >> or not all ptys are busy -- process-connection-type might not have any >> effect, and the underlying process will rarely (and silently AFAICT) >> operate in pipe mode. By forcing process-connection-type nil, one is >> always testing in the same known mode. > > I don't really understand why pty mode is better here than pipe mode. > Do we need job control, or escape sequences, or anything else specific > to pty? If we use pty, won't these features, on the contrary, get in > the way somewhere? We have to respond to only one prompt from > ldapsearch, and for that pipes should work well. It's not like when the > user is interacting with the process (like in shell mode). The user may > be unaware that external process is at all invoked. Yes, my inclination was (and is) to use pipe mode, but I don't know enough about the implications of either mode, in practice, to definitively say. I searched the mailing list archives and current Emacs source code for process-connection-type and there are many different places where it is set to either t or nil to accommodate some specific operating system or program. Some of these might even have been workarounds for the Darwin process.c bug you seem to have fixed properly. Others, like the one I saw for Solaris, would be harder to test. Unless we can prove that pty mode can fail against ldapsearch -W in some semi-realistic valid use case -- maybe a password with a weird character, or a really really long password that gets buffered or something -- or conversely that pipe mode can fail in some case where pty mode would succeed, then I feel I have to defer to Eli's experience and recommendation. I need to at least give him a chance to update the documentation; hopefully that will clarify when to use each mode definitively. (I also wonder what happens to a process (e.g., Bash) that needs a pty, when all ptys are busy. I haven't done any experiments to check. At least in one case I saw in the source code, ange-ftp.el, the program would just hang in pipe mode. In that case, it seems like there should be a way to tell start-process to signal an error if it doesn't get the desired pty.) > Your suggestion to condionally fix this for Darwin on release looks > good. OK, can you try the attached patch before I push it to emacs-26? > As for 33154, I'll live with it for some more days, and wait for more > people to look at it. And if all goes well, then I'll push it next > week. OK, sounds good. Thanks, Thomas