From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#56336: 28.1.90; [28.1] Emacs prompts for password when output from async command contains "password:" Date: Sat, 02 Jul 2022 14:28:34 +0200 Message-ID: <87tu7z1yx9.fsf@gnus.org> References: <87r13511lv.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20742"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 56336@debbugs.gnu.org To: Jan =?UTF-8?Q?Syn=C3=A1=C4=8Dek?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 02 14:29:10 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o7cFJ-0005DZ-Tt for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Jul 2022 14:29:09 +0200 Original-Received: from localhost ([::1]:51306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7cFI-0005fc-TH for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Jul 2022 08:29:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7cFC-0005fD-Iz for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2022 08:29:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46234) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7cFC-0007ac-AN for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2022 08:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o7cFC-0007Ex-5d for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2022 08:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Jul 2022 12:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56336 X-GNU-PR-Package: emacs Original-Received: via spool by 56336-submit@debbugs.gnu.org id=B56336.165676492427800 (code B ref 56336); Sat, 02 Jul 2022 12:29:02 +0000 Original-Received: (at 56336) by debbugs.gnu.org; 2 Jul 2022 12:28:44 +0000 Original-Received: from localhost ([127.0.0.1]:40130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7cEu-0007EJ-8a for submit@debbugs.gnu.org; Sat, 02 Jul 2022 08:28:44 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:38266) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7cEt-0007E5-Av for 56336@debbugs.gnu.org; Sat, 02 Jul 2022 08:28:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Df3jNPvXxWQOYXY0aGH4UECqIhPEFfrAGPNSmUk72Os=; b=uw+I3gdZ9qxECq++G7L8a8Ocwl IXmuxLGnzG1EIkPhtZVWtvhsqwj4tZM/ROq6Hz0okVK/1CjCGBhi9kmMQFSjG+2F2mlySqNgRxrBH aCW8e4XmIZyxqmhTzkigOh0eIAMyr2CcdFXvdwSfqSuy2AWOJD/vWmfgHP2rd4tqu1KM=; Original-Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o7cEk-00021F-Mn; Sat, 02 Jul 2022 14:28:37 +0200 In-Reply-To: <87r13511lv.fsf@gmail.com> ("Jan =?UTF-8?Q?Syn=C3=A1=C4=8Dek?="'s message of "Fri, 01 Jul 2022 14:03:40 +0200") X-Now-Playing: The Clash's _Sandinista!_: "Rebel Waltz" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:235905 Archived-At: Jan Syn=C3=A1=C4=8Dek writes: > When the output from a command spawned with 'M-&' (async-shell-command) > ends with "password:" Emacs prompts for a password. > > Reproducer: > 0) $ cat /tmp/test.txt > enter your password: > 1) emacs -Q > 2) Press 'M-&', enter 'cat /tmp/test.txt' as input and hit enter. > 3) Emacs prompts for a password. > > I expect that 3) should not happen as the output is simply to stdout and > no stdin input is expected. Note that the reproducer is minimal and a > bit contrived but the real bug showed itself when I was running a big > test suite that contained several lines ending with "password:" in its > output. > > I've also tested this with the latest master (commit > 3a4c408a7b6f3df5ca0eb4a406efbdb4899e9742), where it sometimes happens as > well and sometimes you just get an error like this: > > Error running timer: (error "Buffer *Async Shell Command* has no process") I've now fixed the latter in Emacs 29. The former problem is rather intractable. That is, if you say ssh foo@host you'll get a password prompt as the final line in the buffer, and Emacs will ask you to enter a password. If you say echo -n "password: "; sleep 10; echo foo then there's no way for Emacs to distinguish that from the ssh situation: It sees a prompt as the last thing in the buffer, and Emacs can't possibly know that that's not a process asking for a password. Note that echo "password: "; echo foo; sleep 10 won't ask for a password. So I don't know that there's any way to fix this -- Emacs uses a heuristic, and it will be wrong in some cases. Or does anybody have any ideas here? --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no