From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#43003: 28.0.50; comint-password-prompt-regexp too restrictive Date: Mon, 31 Aug 2020 14:05:48 +0200 Message-ID: <87imczf2ar.fsf@gmx.net> References: <87pn7hawal.fsf@gmx.net> <878se4dy9u.fsf@gnus.org> <87lfi1emz4.fsf@gmx.net> <873648xmvf.fsf@gnus.org> <87sgc83z3k.fsf@gmx.net> <87mu2evp51.fsf@gnus.org> <87tuwm95za.fsf@gmx.net> <87a6yctfmi.fsf@gnus.org> <87mu2btbd9.fsf@gmx.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8645"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 43003@debbugs.gnu.org, Lars Ingebrigtsen To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 31 14:06:36 2020 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 1kCia3-00028x-9w for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 Aug 2020 14:06:35 +0200 Original-Received: from localhost ([::1]:47440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCia2-00044V-5d for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 Aug 2020 08:06:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCiZW-00044O-OB for bug-gnu-emacs@gnu.org; Mon, 31 Aug 2020 08:06:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40216) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kCiZW-0008EN-FY for bug-gnu-emacs@gnu.org; Mon, 31 Aug 2020 08:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kCiZW-0004fH-8x for bug-gnu-emacs@gnu.org; Mon, 31 Aug 2020 08:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 31 Aug 2020 12:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43003 X-GNU-PR-Package: emacs Original-Received: via spool by 43003-submit@debbugs.gnu.org id=B43003.159887556017924 (code B ref 43003); Mon, 31 Aug 2020 12:06:02 +0000 Original-Received: (at 43003) by debbugs.gnu.org; 31 Aug 2020 12:06:00 +0000 Original-Received: from localhost ([127.0.0.1]:51762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kCiZU-0004f1-AW for submit@debbugs.gnu.org; Mon, 31 Aug 2020 08:06:00 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:57825) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kCiZR-0004el-IB for 43003@debbugs.gnu.org; Mon, 31 Aug 2020 08:05:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1598875550; bh=JrlIKyotybtWnaslOSZSvGK28qTexYDBJx4+aFXV+0I=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=BnuULGPJafapWQjBYX7yP3jgtfoQCPk0KZAwmL24ZYXSS4w2Ytjee0rjY5TiqT39N /Y/iLrfewh55j6qL4eVS6KXf8esH3Ugt6Kvru0dkJYMU7umMtVyZ+mpuo+r40mzqBB eif6ptKPPI/Ecfz1EsdZzvc0A5uf0/hLbtHBhuAg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobe-jhalfs ([178.6.210.84]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MxDkw-1kWKsY2WYi-00xeAZ; Mon, 31 Aug 2020 14:05:50 +0200 In-Reply-To: (Robert Pluim's message of "Mon, 31 Aug 2020 12:11:54 +0200") X-Provags-ID: V03:K1:j7gdZmVriVCoRzkpV1ZVzW40gQEwVz3lfhpiH+ujVjd13x3RNvY WK8kbIprF8t9NcQq87qtFYVpSZHiEMU+iNSALextmTyLmzwRnL/4BW+jJ/R3YsN9GBs7adu knpdkrOl/CJS5hDSa0IkkzkF/t7/3/zJ8mhGrKb2/ilXQM7jBe5uRfEj4EYimd5XINv+Xcp SLnuVc1YDpG0M9mXIiopQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:O1jZAMEaSUU=:HIwa3UivXsbvqXpLVEXHu3 8UWEBjKOSddDqrrwmOWhcAQfp0nwfpU5lqKbUFIuWp8RisiEOMr+icwkocxjGcpmOVsbAuR0E 8Cm/3aTz1scim2j78RG0sq59zTlk8qXzxxt/OSU3ULw+Epzrv+5sa2MEUwXsZ29xg8iX+/oix /qIhZ0nQUXR1vNFZf3a9zs1eiLd2SLttBgSg3eMa89g5EWdH4OL+xUunVl63yHfWuLkkDKKF7 mcdV6eEF5C5OcF4MlV+DRWNRALTW+EEXvVheD8qGvcZNabACpPTWGVyOfbS7Zr4xD3mN9Bplp zUOppWeMDqFnA4bxPYrAcdnEINbCWcpEY4gvqwU63dNc9lchzQgdGnQbFunLpfDfuU/oZb5ze kTo3TOVEHHErx5LrOHHp5uphGtLLGjKDXW96rlXXL7McST4sLrLwF75DNngUBiviDGMocKnsw ORyqFZqPTo2tfm8Cux8WwntUviItrxfiJNK62/N27s5akHKd8Ty2yux72JNMDQSZWZZ3Th9s1 d5GoDLQ7Uhk2qpeVajEEOlWPcjTafdFgkMuYkPwY9SaiWd1iA7htcjRqbrfdAPyeyuAklf1br X66Cgzg2XAOtkrL0+wdMS1SD4H6v3IqF7VFM7TpKxgjFtWZndxln00oKzkEnHflI88S3qL+e2 4k0EOc0JujSEeLqi1P729piu3VzqSemaeMzYWX+MnPjr8KkQs64/iSmUOFke8IFPX6nVEc6Ut YDPynpWsmYA3JZdleAD8cBEuA8FHhJd1PZP/j8GW3nN5/bZw/WRFt0SVOfyhBqbYpC7RCjXT 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:186763 Archived-At: On Mon, 31 Aug 2020 12:11:54 +0200 Robert Pluim wrote: >>>>>> On Mon, 31 Aug 2020 11:26:10 +0200, Stephen Berman > said: > > Stephen> On Sun, 30 Aug 2020 15:41:57 +0200 Lars Ingebrigtsen > Stephen> wrote: > >> Stephen Berman writes: > >> > >>> True, I wasn't thinking about that. Then I guess it's best to l= eave > >>> comint-password-prompt-regexp as is and I'll just change it loca= lly. > >>> The problem I have with it doesn't seem to be widespread, to say= the > >>> least. So feel free to close the bug. > >> > >> OK; done. > > Stephen> A postscript with additional datapoints: In my OP, the the = system that > Stephen> the problem occurs on (Linux From Scratch) uses openssh 8.2= p1, while the > Stephen> system without the problem (an older Linux From Scratch) us= es openssh > Stephen> 7.9p1. I've now reproduced the problem on two other GNU/Li= nux systems: > Stephen> current openSUSE Tumbleweed, which uses openssh 8.3p1 (and = I see the > Stephen> problem here on two different machines), and openSUSE Leap = 15.2, which > Stephen> uses openssh 8.1p1. This supports my conjecture that the p= roblematic > Stephen> carriage return in the prompt comes from openssh. If anyon= e else > Stephen> running a system with openssh 8.{1,2,3}p1 can reproduce the= problem, > Stephen> then perhaps a different way of handling it than changing t= he default > Stephen> value of comint-password-prompt-regexp can be found. > > That matches the analysis done in > > https://emacs.stackexchange.com/questions/60394/unable-to-push-into-gith= ub-using-magit > > which leads to: > > https://github.com/magit/magit/issues/3843 > > TL;DR magit decided to strip the \r from the prompt received from > openssh. Ah, thanks for the pointer. I'd done a web search before my first post about this but didn't find those pages. > We could strip control characters in comint-watch-for-password-prompt, > but then people who've legitimately put control characters in > comint-password-prompt-regexp will get annoyed. > > Perhaps just strip '\r'? (And document it, of course) > > diff --git a/lisp/comint.el b/lisp/comint.el > index be0e32b9e0..74c5c7f94f 100644 > --- a/lisp/comint.el > +++ b/lisp/comint.el > @@ -2427,7 +2427,8 @@ comint-watch-for-password-prompt > > This function could be in the list `comint-output-filter-functions'." > (when (let ((case-fold-search t)) > - (string-match comint-password-prompt-regexp string)) > + (string-match comint-password-prompt-regexp > + (replace-regexp-in-string "\r" "" string))) > (when (string-match "^[ \n\r\t\v\f\b\a]+" string) > (setq string (replace-match "" t t string))) > (let ((comint--prompt-recursion-depth (1+ comint--prompt-recursion-= depth))) That works for me. Thanks, Steve Berman