From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.bugs Subject: bug#33050: 27.0.50; [macOS] Problem with process input with process-connection-type nil Date: Mon, 22 Oct 2018 18:35:43 +0300 Message-ID: References: <83a7n9udxv.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1540222457 10878 195.159.176.226 (22 Oct 2018 15:34:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 22 Oct 2018 15:34:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (darwin) Cc: 33050@debbugs.gnu.org, fitzsim@fitzsim.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 22 17:34:13 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gEcDb-0002fZ-Ri for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Oct 2018 17:34:12 +0200 Original-Received: from localhost ([::1]:35822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEcFi-0007QV-4f for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Oct 2018 11:36:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEcFR-0007Pk-6D for bug-gnu-emacs@gnu.org; Mon, 22 Oct 2018 11:36:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEcFQ-0005rl-7q for bug-gnu-emacs@gnu.org; Mon, 22 Oct 2018 11:36:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60353) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gEcFP-0005rO-Un for bug-gnu-emacs@gnu.org; Mon, 22 Oct 2018 11:36:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gEcFO-0001zB-AG for bug-gnu-emacs@gnu.org; Mon, 22 Oct 2018 11:36:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Filipp Gunbin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Oct 2018 15:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33050 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33050-submit@debbugs.gnu.org id=B33050.15402225497608 (code B ref 33050); Mon, 22 Oct 2018 15:36:02 +0000 Original-Received: (at 33050) by debbugs.gnu.org; 22 Oct 2018 15:35:49 +0000 Original-Received: from localhost ([127.0.0.1]:36378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gEcFB-0001yd-LO for submit@debbugs.gnu.org; Mon, 22 Oct 2018 11:35:49 -0400 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:36391) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gEcFA-0001yW-El for 33050@debbugs.gnu.org; Mon, 22 Oct 2018 11:35:49 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 75B75C46; Mon, 22 Oct 2018 11:35:47 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 22 Oct 2018 11:35:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm1; bh=WT77J5woBNAMwCGjQE0urIRzCJ cslBkKERXX7zhOA1I=; b=r9Gf9bRg24iHwY9JHjSk38B0urvvNHRe0mzBYiZfuP xsUDNPPZ05CxwrA+dMsgVScPZxsf77kgUGz9gU3AB3EahEChvKhI0yr0hBe9BDNh cakNA0pnV0wGo2oDkyK4AcmM/WlBGZJ+hWCOlH3Do13dcuh0foOVhc0sjM9LLPi5 yl7V5rhQlvc7C6gSI3R3apEd+mr7eO8yBXv+RFNNvKepWXz2mkJl2h+YauSiahmn cUM5u4KABa2UVxW/0NT9ojDa0vbBDLpBZikvfXVeAYg/YI+JmDoAM3tGt3l+oPdR 6IMj1nnIRLMfJykVXLrZaoaB+QQIRA+FTIUZEzxGnn5g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=WT77J5 woBNAMwCGjQE0urIRzCJcslBkKERXX7zhOA1I=; b=EKl1cyPrF5hX4gggkCyFLg LxME6blpjHklZQYZlHdvbjyWx90Eku0CzJWWP1fCmMLxc7lSBk2lVKo0lqgGlDDy xAMDIvt6+700CJZEUdPtU7aZ/jPpgTLOsjJABn8ilQccaQ1S5lC2E/9M7oj6R7PA cUFvNhQ+fCCRsqS0gKtw8qM5Vgpfr+eARtJ8Uc/5aWJceGA3dK2+9832A0QajVdo lGt8VP530VbvLWa4LxtE6iJ68lDEBEVIggFyUHdsR8NCJeuzguTWAm66mPJaJC1I gEae0/4bkEEC/9OGqh0j+g0d1ifjuOKOmHMd/dlNCyu4v/XLpQvoq5Jj2NA47wrg == X-ME-Sender: X-ME-Proxy: Original-Received: from fgunbin.playteam.ru (unknown [95.161.147.10]) by mail.messagingengine.com (Postfix) with ESMTPA id B8987E43AC; Mon, 22 Oct 2018 11:35:45 -0400 (EDT) In-Reply-To: <83a7n9udxv.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 20 Oct 2018 13:09:48 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:151506 Archived-At: On 20/10/2018 13:09 +0300, Eli Zaretskii wrote: >> From: Filipp Gunbin >> Date: Mon, 15 Oct 2018 22:03:19 +0300 >> >> If I let-bind process-connection-type to t (use pty) in above code, then >> it works normally: >> >> *Messages* : >> proc status: run >> found prompt >> proc status: run >> exited >> "exited" >> >> Buffer "my-process-buf": >> enter something: >> Process my-process<2> finished >> >> But if I let-bind process-connection-type to nil (so does ldap.el), then >> it hangs, and after a few seconds wait and C-g, *Messages* has only >> this: "proc status: run [6 times]", and buffer my-process-buf is empty. > > The reason is almost certainly buffering: when the connection is via a > pipe, the subprocess writes in buffered mode, so it might take quite a > few characters of input before /usr/bin/read outputs something. Try > using the -n or -N options, and see if that helps. Thanks for looking at this. I tried wrapping read in stdbuf, but it didn't change anything: (start-process "my-process" buf "stdbuf" "-o0" "/usr/bin/read" "-p" "enter something:") read -n won't help either, because it can affect the number of chars "read" reads - while in my example we are just waiting for prompt. > Why does ldap.el set process-connection-type to nil? I don't know, and it seems like it should not mingle with this setting at all (why should it?) I've CC'ed Thomas, who is the author of these lines (ldap.el line 649), according to git blame. Filipp