From: Thomas Fitzsimmons <fitzsim@fitzsim.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 33050@debbugs.gnu.org, fgunbin@fastmail.fm, alan@idiocy.org
Subject: bug#33050: 27.0.50; [macOS] Problem with process input with process-connection-type nil
Date: Fri, 26 Oct 2018 11:41:02 -0400 [thread overview]
Message-ID: <m3va5oemwh.fsf@fitzsim.org> (raw)
In-Reply-To: <83sh0tp4z4.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 26 Oct 2018 10:00:31 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Thomas Fitzsimmons <fitzsim@fitzsim.org>
>> Cc: Filipp Gunbin <fgunbin@fastmail.fm>, 33050@debbugs.gnu.org, alan@idiocy.org
>> Date: Thu, 25 Oct 2018 21:41:34 -0400
>>
>> > I don't understand why: using nil process-connection-type for programs
>> > that prompt the user is a bug anyway.
>>
>> I'm interested to know why you think this is a bug (or even not
>> preferable) in the specific case of ldap.el. When ldap.el calls
>> ldapsearch, ldapsearch doesn't prompt the user for the password
>> directly. ldap.el (having pre-read the password into Elisp by various
>> means) runs the command, and, in response to its prompt, sends it the
>> password.
>
> First, I must apologize in advance: I might be mis-interpreting the
> situation, because I don't use ldap.el or ldapsearch. In that case,
> what I said before and what I say below might not make sense.
>
> That said, my rationale was simple: _any_ program that interacts with
> the user will generally behave better when connected through pty than
> when connected through a pipe, because the former looks and feels as a
> terminal, and thus will cause the program to use the appropriate
> buffering, will support terminal-only features like various escape
> sequences, cursor control, job control, etc. Using pipes will
> probably work in most cases, but might fail in some of them, so good
> engineering tells us to prefer pty's, like the ELisp manual says.
OK, this makes sense, thanks for providing the rationale. Given that
ldapsearch does issue a human-readable prompt for the password, it was
likely written and tested assuming a pty.
>> I re-read the Elisp "Asynchronous Processes" node; when I was deciding
>> how to set process-connection-type, I think I was following the
>> _underlined_ part in:
>>
>> [...] If available, ptys are usually preferable for processes visible
>> to the user, as in Shell mode, because they allow for job control
>> (‘C-c’, ‘C-z’, etc.) between the process and its children, and
>> because interactive programs treat ptys as terminal devices, whereas
>> pipes don’t support these features. However, _for subprocesses used
>> by Lisp programs for internal purposes, it is often better to use a
>> pipe_, because pipes are more efficient, and because they are immune
>> to stray character injections that ptys introduce for large (around
>> 500 byte) messages. Also, the total number of ptys is limited on
>> many systems and it is good not to waste them.
>>
>> Given that ldapsearch can operate over a pipe (i.e., doesn't need
>> terminal features, seems to be unaffected by buffering), and is used for
>> internal purposes (i.e., is not visible to the user) isn't pipe mode
>> preferable for the reasons given there?
>
> Not in my opinion, no. AFAIU, the efficiency considerations don't
> really apply here, since the amount of data exchanged is small
> (right?).
Right.
> All in all, I consider the "however" part above too vague to be useful
> (what exactly does "internal purposes" mean in this context?). I
> think it's even slightly misleading. I'll think about rewording it to
> make the point more clear and the decision easier.
OK, sounds good. 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.
That said, it is probably a bad idea to warn or signal an error if all
ptys are busy in the p-c-t t case. Anyway, I thought I'd mention it;
maybe the documentation update can address this point as well.
How about I make the change conditional on Mac OS on the release branch,
and unconditional on the master branch (once the fix for 33154 is
committed)? That way users on the master branch will be able to test
pty mode before the next release, and we fix the release branch without
potentially destabilizing non-Darwin users.
Thomas
next prev parent reply other threads:[~2018-10-26 15:41 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-15 19:03 bug#33050: 27.0.50; [macOS] Problem with process input with process-connection-type nil Filipp Gunbin
2018-10-20 10:09 ` Eli Zaretskii
2018-10-22 15:35 ` Filipp Gunbin
2018-10-23 1:53 ` Thomas Fitzsimmons
2018-10-23 22:41 ` Filipp Gunbin
2018-10-24 1:55 ` Thomas Fitzsimmons
2018-10-24 13:13 ` Filipp Gunbin
2018-10-24 14:05 ` Filipp Gunbin
2018-10-24 16:20 ` Thomas Fitzsimmons
2018-10-24 19:33 ` Filipp Gunbin
2018-10-24 19:46 ` Filipp Gunbin
2018-10-24 22:07 ` Thomas Fitzsimmons
2018-10-25 15:51 ` Filipp Gunbin
2018-10-25 16:24 ` Eli Zaretskii
2018-10-25 17:10 ` Filipp Gunbin
2018-10-25 17:29 ` Eli Zaretskii
2018-10-25 18:10 ` Filipp Gunbin
2018-10-25 18:20 ` Eli Zaretskii
2018-10-25 19:36 ` Filipp Gunbin
2018-10-25 19:40 ` Eli Zaretskii
2018-10-25 20:47 ` Filipp Gunbin
2018-10-26 6:29 ` Eli Zaretskii
2018-10-26 1:41 ` Thomas Fitzsimmons
2018-10-26 7:00 ` Eli Zaretskii
2018-10-26 15:41 ` Thomas Fitzsimmons [this message]
2018-10-26 17:20 ` Eli Zaretskii
2018-10-27 10:20 ` Eli Zaretskii
2018-10-27 13:42 ` Thomas Fitzsimmons
2018-10-27 14:53 ` Eli Zaretskii
2018-10-27 16:53 ` Thomas Fitzsimmons
2018-10-27 18:49 ` Eli Zaretskii
2018-10-26 23:12 ` Filipp Gunbin
2018-10-27 2:09 ` Thomas Fitzsimmons
2018-10-27 14:52 ` Filipp Gunbin
2018-10-30 0:49 ` Thomas Fitzsimmons
2018-10-30 19:11 ` Filipp Gunbin
2018-11-28 23:09 ` Filipp Gunbin
2018-11-29 7:21 ` Eli Zaretskii
2018-11-29 8:46 ` Filipp Gunbin
2018-11-29 9:19 ` Eli Zaretskii
2018-11-29 9:51 ` Filipp Gunbin
2018-11-29 10:41 ` Eli Zaretskii
2018-11-29 14:09 ` Filipp Gunbin
2018-12-03 14:17 ` Thomas Fitzsimmons
2018-12-04 12:37 ` Filipp Gunbin
2018-12-22 15:05 ` Thomas Fitzsimmons
2018-10-27 6:59 ` Eli Zaretskii
2018-10-27 14:37 ` Filipp Gunbin
2018-10-27 20:28 ` Charles A. Roelli
2018-10-28 16:00 ` Eli Zaretskii
2018-10-28 19:53 ` Charles A. Roelli
2018-10-25 16:41 ` Filipp Gunbin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3va5oemwh.fsf@fitzsim.org \
--to=fitzsim@fitzsim.org \
--cc=33050@debbugs.gnu.org \
--cc=alan@idiocy.org \
--cc=eliz@gnu.org \
--cc=fgunbin@fastmail.fm \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.