From unknown Fri Jun 13 10:38:06 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#39399 <39399@debbugs.gnu.org> To: bug#39399 <39399@debbugs.gnu.org> Subject: Status: tramp depends on unstable details of shell command line processing Reply-To: bug#39399 <39399@debbugs.gnu.org> Date: Fri, 13 Jun 2025 17:38:06 +0000 retitle 39399 tramp depends on unstable details of shell command line proce= ssing reassign 39399 emacs submitter 39399 John F Carr severity 39399 normal tag 39399 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 02 16:29:06 2020 Received: (at submit) by debbugs.gnu.org; 2 Feb 2020 21:29:06 +0000 Received: from localhost ([127.0.0.1]:40672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iyMni-0003Iw-0Y for submit@debbugs.gnu.org; Sun, 02 Feb 2020 16:29:06 -0500 Received: from lists.gnu.org ([209.51.188.17]:48277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iyMng-0003Io-0f for submit@debbugs.gnu.org; Sun, 02 Feb 2020 16:29:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53138) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyMne-0002sl-0w for bug-gnu-emacs@gnu.org; Sun, 02 Feb 2020 16:29:03 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_MED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iyMnb-00050l-5t for bug-gnu-emacs@gnu.org; Sun, 02 Feb 2020 16:29:01 -0500 Received: from outgoing-exchange-5.mit.edu ([18.9.28.59]:34860) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iyMnb-0004zy-2N for bug-gnu-emacs@gnu.org; Sun, 02 Feb 2020 16:28:59 -0500 Received: from w92exedge4.exchange.mit.edu (W92EXEDGE4.EXCHANGE.MIT.EDU [18.7.73.16]) by outgoing-exchange-5.mit.edu (8.14.7/8.12.4) with ESMTP id 012LVXO6003414 for ; Sun, 2 Feb 2020 16:31:50 -0500 Received: from OC11EXPO29.exchange.mit.edu (18.9.4.102) by w92exedge4.exchange.mit.edu (18.7.73.16) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Sun, 2 Feb 2020 16:26:52 -0500 Received: from OC11EXPO29.exchange.mit.edu (18.9.4.102) by oc11expo29.exchange.mit.edu (18.9.4.102) with Microsoft SMTP Server (TLS) id 15.0.1365.1; Sun, 2 Feb 2020 16:28:40 -0500 Received: from OC11EXPO29.exchange.mit.edu ([18.9.4.102]) by oc11expo29.exchange.mit.edu ([18.9.4.102]) with mapi id 15.00.1365.000; Sun, 2 Feb 2020 16:28:40 -0500 From: John F Carr To: "bug-gnu-emacs@gnu.org" Subject: tramp depends on unstable details of shell command line processing Thread-Topic: tramp depends on unstable details of shell command line processing Thread-Index: AQHV2g+8Za6b5HSxCUGFARxk5V5iKA== Date: Sun, 2 Feb 2020 21:28:40 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [108.7.221.50] Content-Type: text/plain; charset="us-ascii" Content-ID: <54D03A83E9FFC645973CC548FBFA19BF@exchange.mit.edu> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 18.9.28.59 X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) I use emacs tramp mode for remote editing. It stopped working on my FreeBS= D systems when I upgraded to a development version. The cause appears to b= e due to /bin/sh reprinting the entire line when a backspace is sent rather= than sending only a backspace-space-backspace sequence. The failure follo= ws a change in the line editing library (shared with NetBSD) rather than th= e shell itself. Environment is emacs 24.5 or 26.3 running on Mac OS Catalina. The remote s= ystem is FreeBSD 13.0 development. Tramp works with Linux or FreeBSD 12.1 = as the remote system. Here's what happens. I load tramp and open a file like /ssh:user@host:/. Emacs spawns ssh to co= nnect. The first thing tramp does is send stty -inlcr -onlcr -echo kill '^U' erase '^H' But this doesn't do much because the tty is in raw mode rather than cooked = due to the shell's line editor. So tramp falls back to a hack to detect ec= hoed input. It sends "_echo" followed by a string of backspace characters.= "_echo" is unlikely to appear in program output. Here is the next command after the initial stty: _echo^H^H^H^H^Hstty icanon erase ^H cols 32767_echo^H^H^H^H^H The groups of 5 ^H represent 5 backspace characters and the lone ^H in the = middle is a two character sequence for stty. The terminal output from a 12.1 system is _echo^H ^H^H ^H^H ^H^H ^H^H ^Hstty icanon erase ^H cols 32767_echo^H ^H^H ^= H^H ^H^H ^H^H ^H #$=20 where again the middle ^H is a two character sequence and the others are ba= ckspace characters. There is a carriage return between the two lines. "#$ = " is the shell prompt set by tramp. The terminal output from a FreeBSD 13.0 development branch system is _echo #$ _ech ^H #$ _ec ^H #$ _e ^H #$ _ ^H #$ ^Hstty icanon erase ^H cols 32767_echo #$ stty icanon erase ^H cols 32767_ech ^H #$ stty icanon erase ^H cols 32767_ec ^H #$ stty icanon erase ^H cols 32767_e ^H #$ stty icanon erase ^H cols 32767_ ^H #$ stty icanon erase ^H cols 32767 ^H #$=20 with carriage returns between lines. This does not make sense to emacs, wh= ich hangs waiting for something it recognizes. I can recover by hitting co= ntrol-G which aborts the tramp connection. This issue is also reported to FreeBSD at https://bugs.freebsd.org/bugzilla= /show_bug.cgi?id=3D243807.= From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 03 03:58:39 2020 Received: (at 39399) by debbugs.gnu.org; 3 Feb 2020 08:58:39 +0000 Received: from localhost ([127.0.0.1]:40861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iyXZ1-0004rY-FV for submit@debbugs.gnu.org; Mon, 03 Feb 2020 03:58:39 -0500 Received: from mout.gmx.net ([212.227.15.15]:53219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iyXYz-0004rH-Ds for 39399@debbugs.gnu.org; Mon, 03 Feb 2020 03:58:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1580720307; bh=MVQFae+cdrG/sxJBZbS6AOcnHYb1/IZkMMOaHgVjHn4=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=bzxALbTK1biYWgN0SHnDPDH/dylUjJfD0Fbyw9AMIyKDgAvNVFxXbbuMSEzndQbWE S6ib/G7LHyWMp0gHpGs7o67sPkMXDTRAYAQI66L0VQpEp2nDWGMzR61G4LMHP/1aX4 pMUhmVgbMhgaArWmWXCBsyKOgre+MVN6k/DMV/cY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from detlef.gmx.de ([212.86.41.255]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MhU5R-1jSOav3nKF-00ec7r; Mon, 03 Feb 2020 09:58:27 +0100 From: Michael Albinus To: John F Carr Subject: Re: bug#39399: tramp depends on unstable details of shell command line processing References: Date: Mon, 03 Feb 2020 09:58:26 +0100 In-Reply-To: (John F. Carr's message of "Sun, 2 Feb 2020 21:28:40 +0000") Message-ID: <87v9ooujwt.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:P6XfuCkPoGebDg8ceRsvfDLao+JsB+lHQWRkug893IgRCo6ZFz5 GRLSnV3T0Bx/V98hJCZXnC9lPU+4IZUMgzT8WP1nBcokC8HS9j3CfGsC/OY0oU/mLvhg2oP lGa/JnHnqCvv/mhNUeTze0658xIiTlpgroyOIBFQHuuOdARarldfTw33f6P3AWsY4YmdOf8 Q1Nv4BS6p1WGXAggHkEtw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:ZAlFDP+LKG8=:9Jh2PDdasPz045jxHnDzXB uGhy2JftlCS28o5PtJQVnDR7Hg3MLWHQaTpSbdQN2+Onc1h0iAfn5qjldYFRXK2BDa16xl3Xf Op5JlbMbumkE7XigvwEbf2YpAKsaddrJizVJCiaaRvJ1jR5/1P4L5OQncgEZj0iKjtQrFujn5 Zb+p/G+160g444gwp149XMHGHMpafsxMlvmiRdvEgH+N+dG2t7tyoliMR99irUIS4x+bfl6zU RaunEapzxhwQPd4suywW4bVT/rngRjAHkdgmCzWumTYM0JonuduB70HIZAGCsV+qEkD39L+12 /3dr9XQT1sGqgLwEDgvLZFEKHZArg05er/MeG9HpIPd3HGiS1v+iQy6Xs7xukoiLy21mdLI31 579RA+o50X6Pn/3QbhsKOiObjCNfPcKbWjLTVv1UNWlLKMDCixzpmBE2xFgV7JCZ7Enjp13zV U6OgA6IfPasiio8x/S3K5QJtJiHMkpoKkb+OG+B3aCyRIz4riyb1MxBcfZv+gUucKwfy3t0Rc cCmQYICRAlH7Sfttp05cUMPKjhH/Thc9zJGsAYuuanjis42i6uEnZaBQT6L/WLUNDFhGN5KTa 5Wc+rIXuIBiFyT3aX3UJ0IYe3fgaYXOS9g+SNcClveqVKM+5nanJKEmRD20O6jN+jIrecglyj q1zqWwv7luj9Bd5oXIII4cNVbnheebHdu9tIVeH9617kpVet4Ag719L6HHDXLZXYPLm047s+U IcO5Nia6fF0dC7tsI3q35XAAAYsgKw6etu4L7qbYb/Ezbz95evMeM4S7zOoWXEUOf/TGM9AF5 eYD4K8qXexkZZWrhMbgvuuLjhMLOZA07Pag7636OwzaqmKSf/QIgUTRkW7V4OgsQZLHERE8bM D4UdpiQquvxwkXn93LojchodHj7HK2l87g1dswQQnxmQkKnaKPTdAWgS6EElF8p9Y06rd5t7Z n8W0VxdByP3rnl64heBjDyif8R648JMx/NOqnstrPklLrpysXLQaUVa5kSu5RCUE3lhBY59Y9 zEtkajIkCPVEmoj9KrHK1dSrhHbX2jfet4LRSlFKpvE1woB6eXYwJNYLu3cOqOvQiNU0zx1RN IWPvPRWcutFwtLoflaniCwj4P4HlaH8WARb0JIsWXrkyPjBsJ8Br4bSnVcA+2gNz8V6uhHhlm hDpijCfJwLkGLqmCfyiPXe9AM54q6w+GKMcgJpxFE4i/VGWFY2OlH6VaiJ7/ItTItgTwW57u9 y+VarG8wjHKPtBg6m Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39399 Cc: 39399@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) John F Carr writes: Hi John, > I use emacs tramp mode for remote editing. It stopped working on my > FreeBSD systems when I upgraded to a development version. The cause > appears to be due to /bin/sh reprinting the entire line when a > backspace is sent rather than sending only a backspace-space-backspace > sequence. The failure follows a change in the line editing library > (shared with NetBSD) rather than the shell itself. > > Environment is emacs 24.5 or 26.3 running on Mac OS Catalina. The > remote system is FreeBSD 13.0 development. Tramp works with Linux or > FreeBSD 12.1 as the remote system. Thanks a lot for your report! Since I'm not running FreeBSD anywhere, I count on your support fixing the problem :-) > Here's what happens. > > I load tramp and open a file like /ssh:user@host:/. Emacs spawns ssh to= connect. The first thing tramp does is send > > stty -inlcr -onlcr -echo kill '^U' erase '^H' > > But this doesn't do much because the tty is in raw mode rather than > cooked due to the shell's line editor. So tramp falls back to a hack > to detect echoed input. It sends "_echo" followed by a string of > backspace characters. "_echo" is unlikely to appear in program > output. > > Here is the next command after the initial stty: > > _echo^H^H^H^H^Hstty icanon erase ^H cols 32767_echo^H^H^H^H^H > > The groups of 5 ^H represent 5 backspace characters and the lone ^H in t= he middle is a two character sequence for stty. > > The terminal output from a 12.1 system is > > _echo^H ^H^H ^H^H ^H^H ^H^H ^Hstty icanon erase ^H cols 32767_echo^H ^H^= H ^H^H ^H^H ^H^H ^H > #$ > > where again the middle ^H is a two character sequence and the others > are backspace characters. There is a carriage return between the two > lines. "#$ " is the shell prompt set by tramp. Well, and this works for years. > The terminal output from a FreeBSD 13.0 development branch system is > > _echo > #$ _ech ^H > #$ _ec ^H > #$ _e ^H > #$ _ ^H > #$ ^Hstty icanon erase ^H cols 32767_echo > #$ stty icanon erase ^H cols 32767_ech ^H > #$ stty icanon erase ^H cols 32767_ec ^H > #$ stty icanon erase ^H cols 32767_e ^H > #$ stty icanon erase ^H cols 32767_ ^H > #$ stty icanon erase ^H cols 32767 ^H > #$ > > with carriage returns between lines. This does not make sense to > emacs, which hangs waiting for something it recognizes. I can recover > by hitting control-G which aborts the tramp connection. > > This issue is also reported to FreeBSD at https://bugs.freebsd.org/bugzi= lla/show_bug.cgi?id=3D243807. IIUC the discussion in that bug, it is due to the changed libedit of FreeBSD 13. Hmm, don't know this beast. But wouldn't it help, if Tramps sends initially "stty cooked"? Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 04 03:34:40 2020 Received: (at 39399) by debbugs.gnu.org; 4 Feb 2020 08:34:40 +0000 Received: from localhost ([127.0.0.1]:42582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iytfL-0004vp-Q2 for submit@debbugs.gnu.org; Tue, 04 Feb 2020 03:34:40 -0500 Received: from mout.gmx.net ([212.227.15.19]:39107) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iytfJ-0004vb-K2 for 39399@debbugs.gnu.org; Tue, 04 Feb 2020 03:34:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1580805268; bh=ow0HsuwQ84tF0+KTgX3fY2Vgisb9Yh7eCyt0UvKt0Gs=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=MGaD5841JinbStTFN0D9lk9QZdl+iK3b9dJs6YLh/10kNdp7rPkV6hAZ9Xhp6sWXl rflrURRjpNYuUh5J00bcpgzgb5zwxXLMLQZfzis+njGOJ8FzOyFCr92E7vAI7obP7g 14JXgJ8G8RYcNptBT5mz/SF4nxsW4oIS9wE33eIE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from detlef.gmx.de ([79.140.118.126]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N1fis-1jerDH333w-0122IK; Tue, 04 Feb 2020 09:34:27 +0100 From: Michael Albinus To: John F Carr Subject: Re: bug#39399: tramp depends on unstable details of shell command line processing References: <87v9ooujwt.fsf@gmx.de> Date: Tue, 04 Feb 2020 09:34:26 +0100 In-Reply-To: <87v9ooujwt.fsf@gmx.de> (Michael Albinus's message of "Mon, 03 Feb 2020 09:58:26 +0100") Message-ID: <87pneuvjhp.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:mkAZZ2AmmcldxkYedeGX4UkWKQ83D+LiO3XF+1LiYKHbqmwXVOf gb+eQHzIgmOa48dFqyTNN7ZqkGWHrnKZYX2syvjsTg/bfhrnucDkmMNdeHg5wH6DvPX4C5c K+noXVUAD2r6oQKyKeNUxIaFbOLXipArot3UBqzj0pb+ztQ0g1M5g8SHuWhsC1qkh+UlH4J 04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42dMQMfOb8wrdbCu6XsVIOb8T9+1QlX3xNZl9IOCAL+cqlv70 DG0WHL12OfYRCZwvWsjFyRr9ni6VJuz+d8tECStKADC3fte1vuOe+zzIE/BSASkYiFjpepY+r eY415RZnj6T9L/8wwQCePwDFD99Tq+dI7AEIcECAWxLXjn5K9aZpzqC9BNMa0LuKozbXrfLUa vMPa1pdtBl7Ho1/m7VU5tWb4XFgTpbraj7QRvTsm++yJaIrc7PqZS+/iZCoxqzCC3P5ZuvsCG bfYxftki+qQ99RE3b X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39399 Cc: 39399@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Michael Albinus writes: Hi John, >> The terminal output from a FreeBSD 13.0 development branch system is >> >> _echo >> #$ _ech ^H >> #$ _ec ^H >> #$ _e ^H >> #$ _ ^H >> #$ ^Hstty icanon erase ^H cols 32767_echo >> #$ stty icanon erase ^H cols 32767_ech ^H >> #$ stty icanon erase ^H cols 32767_ec ^H >> #$ stty icanon erase ^H cols 32767_e ^H >> #$ stty icanon erase ^H cols 32767_ ^H >> #$ stty icanon erase ^H cols 32767 ^H >> #$ >> >> with carriage returns between lines. This does not make sense to >> emacs, which hangs waiting for something it recognizes. I can recover >> by hitting control-G which aborts the tramp connection. >> >> This issue is also reported to FreeBSD at >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243807. > > IIUC the discussion in that bug, it is due to the changed libedit of > FreeBSD 13. Hmm, don't know this beast. But wouldn't it help, if Tramps > sends initially "stty cooked"? I've digged further. Likely, the problem can be avoided if we disable command line editing of the shell. Tramp does it already if the remote shell is zsh; I've added a similar parameter to the bash invocation. For other shells, like ksh, I haven't found a simple parameter. For that class of shells, I've added code which installs a temporary ~/.editrc file, containing the line 'edit off'. Could you please migrate to Tramp 2.4.3.1 from GNU ELPA? On top of this, install the appended patch. And pls report, whether it works for you. Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el index 661e344d..49519926 100644 =2D-- a/lisp/tramp-sh.el +++ b/lisp/tramp-sh.el @@ -537,12 +537,13 @@ based on the Tramp and Emacs versions, and should no= t be set here." ;;;###tramp-autoload (defcustom tramp-sh-extra-args - '(("/bash\\'" . "-norc -noprofile") + '(("/bash\\'" . "-noediting -norc -noprofile") ("/zsh\\'" . "-f +Z -V")) "Alist specifying extra arguments to pass to the remote shell. Entries are (REGEXP . ARGS) where REGEXP is a regular expression matching the shell file name and ARGS is a string specifying the -arguments. +arguments. These arguments shall disable line editing, see +`tramp-open-shell'. This variable is only used when Tramp needs to start up another shell for tilde expansion. The extra arguments should typically prevent the @@ -4107,6 +4108,24 @@ file exists and nonzero exit status otherwise." vec 5 (format-message "Opening remote shell `%s'" shell) ;; Find arguments for this shell. (let ((extra-args (tramp-get-sh-extra-args shell))) + ;; The readline library can disturb Tramp. For example, the + ;; very recent version of libedit, the *BSD implementation of + ;; readline, confuses Tramp. So we disable line editing. Since + ;; $EDITRC is not supported on all target systems, we must move + ;; ~/.editrc temporarily somewhere else. For bash and zsh we + ;; have disabled this already, see `tramp-sh-extra-args'. Bug#3939= 9. + (unless extra-args + (tramp-send-command + vec (eval-when-compile + (concat + "(rm -f ~/.editrc.tramp; " + "mv -f ~/.editrc ~/.editrc.tramp; " + "echo 'edit off' >~/.editrc)")) + t t) + (while + (tramp-accept-process-output (tramp-get-connection-process vec) 0))) + ;; It is useful to set the prompt in the following command + ;; because some people have a setting for $PS1 which /bin/sh ;; doesn't know about and thus /bin/sh will display a strange ;; prompt. For example, if $PS1 has "${CWD}" in the value, then ;; ksh will display the current working directory but /bin/sh @@ -4140,6 +4159,9 @@ file exists and nonzero exit status otherwise." (tramp-shell-quote-argument tramp-end-of-output) shell (or extra-args "")) t) + (unless extra-args + (tramp-send-command + vec "test -e ~/.editrc.tramp && mv -f ~/.editrc.tramp ~/.editrc" t)) ;; Check proper HISTFILE setting. We give up when not working. (when (and (stringp tramp-histfile-override) (file-name-directory tramp-histfile-override)) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 04 03:34:58 2020 Received: (at control) by debbugs.gnu.org; 4 Feb 2020 08:34:58 +0000 Received: from localhost ([127.0.0.1]:42585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iytfe-0004wM-6A for submit@debbugs.gnu.org; Tue, 04 Feb 2020 03:34:58 -0500 Received: from mout.gmx.net ([212.227.17.20]:40611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iytfc-0004w8-N3 for control@debbugs.gnu.org; Tue, 04 Feb 2020 03:34:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1580805290; bh=MTKmsgQHGBWC8U0GumqLzutNnJ2TFj7AwLk3u2VO1wE=; h=X-UI-Sender-Class:Date:To:From:Subject; b=WUD+ijzoMbivKLmLeOoo/CjkZ2XTJ8cLJdyQvha9PTBtxNRJifGgU+csoKxRiNHNI 7xYDkCbwlUFrWLqZ3yi+rFRqkMUh1MIaTdJNm35zX2EsyE+VSNa6LO5fAH7VcF+5Ek uXMM5Z73OXyO712Batq5tkD4Z6+chEtR+pPtWjH0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from detlef.gmx.de ([79.140.118.126]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mzyyk-1jnAHE2Mli-00x2ga for ; Tue, 04 Feb 2020 09:34:50 +0100 Date: Tue, 04 Feb 2020 09:34:49 +0100 Message-Id: <87o8uevjh2.fsf@gmx.de> To: control@debbugs.gnu.org From: Michael Albinus Subject: control message for bug #39399 X-Provags-ID: V03:K1:M5xIWquIE+wgE64thuXteZAE0RNIabTX5gJhO9szJmMfQXaA9n/ DMM4lekHTPrmvc/uE5CHyDhfooKWLhT1PCIhpKgX4Bjau7LmOv5UZ+vApMNu3Jx2liCnAC3 WxiTawYIYLwd14eBS0c2PQclXzZyK9532RS2bf+ZzHqFedLobDo06vy/1WNcdkmVa1bfqoQ BTq3wfMSEooQv4cA68guQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Exgoht8Nrto=:9YmTZxDKGh0A3w5AMkCknz 0ToVaC2IH49GevAcjhAphGMwwnbty2fDtccYWo/CoqQD2Ktt4oN3D8b7R2r+dMZv75BmUjl11 tgwqcXMSZluZjwwF33TYlF8KD5a4QkHGWV9oUQwJUPN429vGJoY5Az1fapG/U8VItIugZbqu7 j4Ty54U2c9KBpWMB75Sx1nMt4Bd48KKlruGEUXm31d55jGz9pfTqGdoBiN+4J6WE+a9GK13xC NKccb7XNkVGlHee0NEUw0EGxIi9M7SLHTc4SPmpIv27JHUoBY63P68cLl9JJSd+0pwe4PQa/z G6a4RAYsLEUwT00l16ACsGt2DYZnA+IQ8XP/IZfPbt6UE/CUwgxFJstdXmckSzGx1tMjpmu6f 8gWo8Vwb3JhYFlqyXPYGKSLprJqRhyCWw7LHFjSa6f08uzgd4Cc/UY2St/v3VujR/ckolflFB YpFJEKP/SD2jqL3FEwZeFq9Pf5RVGjWnud5Os18gqRyyQIiQJOeiLxdNLxUKRvihl+2OkFwuM Sw/vpOePmQU0LVUOXhQzrkpUhjdfobdSzdnFvp5osNWA5WfTnejlrt2lxL35OKv2eWrW+nlcW bfuh7G5GrgC/xg9pJdBcC25xDfKD/04y6KoRw12ShP6QYkV4ylJpn5HZ3wD023PQZoCNpTR7q Y67crBp+Z9xTsSQt0hB63smxty3WVX/8tvv2AehrTuFaGvW87+Axd1zchAFHiE98tB9Jw6I4U ybRff3HdQ/mT8VGjNouwXPB5udNptKPwhAu7UhI9GGi2QP/8d0bD1C/ndOC5151NMemdlWExG 1UnpKZtqZC4vrwhPrCYuIVRJY7whR16++C7am/JVGRG7XxcsFAYOOn/G3drSaeX5fd5yUsk1m TC09QcyP+m+hMxw5Z1QGGVpWuLvTInKUpC4iFD6SOozJCQwrQdr1Dmqau+y4ABUxT61mMemEf RqlvJwWXz1BNWHEedbJZnYGDGeWrgNqxNvtxvGDyKtC/+E34wOkshMozqA/KNsFzz3Pz02BG2 Wzlalg420591bY4U2mBdc+HmRaKgF5VkthIy7s/QkkEe1iyGrpwjJRRQdVmdu3moasNX73UNT kWv4g6u8mJ7Na4w9kwOt4iL9Rn9xCfs5eNt7PY3u1lnJQaiWKcqZdUfj51PtfYMDVpIU3pls2 JWhcSKXQ6jF32mDTMhnwe9ql8DO9av7Roc5rcsKPV7WArhRvp8mfT5olkrgte1OUXGWdefhVH KOJ0AhyLHRgPUBm+k X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) tags 39399 + patch quit From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 05 18:42:10 2020 Received: (at 39399) by debbugs.gnu.org; 5 Feb 2020 23:42:10 +0000 Received: from localhost ([127.0.0.1]:46941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izUJ8-0003Ue-0u for submit@debbugs.gnu.org; Wed, 05 Feb 2020 18:42:10 -0500 Received: from outgoing-exchange-3.mit.edu ([18.9.28.13]:43873) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izUJ5-0003UO-KI for 39399@debbugs.gnu.org; Wed, 05 Feb 2020 18:42:08 -0500 Received: from oc11exedge2.exchange.mit.edu (OC11EXEDGE2.EXCHANGE.MIT.EDU [18.9.3.18]) by outgoing-exchange-3.mit.edu (8.14.7/8.12.4) with ESMTP id 015NfW7g001814; Wed, 5 Feb 2020 18:41:32 -0500 Received: from w92expo29.exchange.mit.edu (18.7.74.41) by oc11exedge2.exchange.mit.edu (18.9.3.18) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Wed, 5 Feb 2020 18:41:40 -0500 Received: from OC11EXPO29.exchange.mit.edu (18.9.4.102) by w92expo29.exchange.mit.edu (18.7.74.41) with Microsoft SMTP Server (TLS) id 15.0.1365.1; Wed, 5 Feb 2020 18:42:00 -0500 Received: from OC11EXPO29.exchange.mit.edu ([18.9.4.102]) by oc11expo29.exchange.mit.edu ([18.9.4.102]) with mapi id 15.00.1365.000; Wed, 5 Feb 2020 18:42:00 -0500 From: John F Carr To: Michael Albinus Subject: Re: bug#39399: tramp depends on unstable details of shell command line processing Thread-Topic: bug#39399: tramp depends on unstable details of shell command line processing Thread-Index: AQHV2zXo96U8tHM0NEm8jW8brsD5NKgNmR4A Date: Wed, 5 Feb 2020 23:42:00 +0000 Message-ID: <7F7FAC1C-A532-4561-88D2-BAD17869C99E@exchange.mit.edu> References: <87v9ooujwt.fsf@gmx.de> <87pneuvjhp.fsf@gmx.de> In-Reply-To: <87pneuvjhp.fsf@gmx.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [108.7.221.50] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 39399 Cc: "39399@debbugs.gnu.org" <39399@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On Feb 4, 2020, at 03:34 , Michael Albinus wrote: >=20 > Michael Albinus writes: >=20 > Hi John, >=20 >>> The terminal output from a FreeBSD 13.0 development branch system is >>>=20 >>> _echo >>> #$ _ech ^H >>> #$ _ec ^H >>> #$ _e ^H >>> #$ _ ^H >>> #$ ^Hstty icanon erase ^H cols 32767_echo >>> #$ stty icanon erase ^H cols 32767_ech ^H >>> #$ stty icanon erase ^H cols 32767_ec ^H >>> #$ stty icanon erase ^H cols 32767_e ^H >>> #$ stty icanon erase ^H cols 32767_ ^H >>> #$ stty icanon erase ^H cols 32767 ^H >>> #$ >>>=20 >>> with carriage returns between lines. This does not make sense to >>> emacs, which hangs waiting for something it recognizes. I can recover >>> by hitting control-G which aborts the tramp connection. >>>=20 >>> This issue is also reported to FreeBSD at >>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D243807. >>=20 >> IIUC the discussion in that bug, it is due to the changed libedit of >> FreeBSD 13. Hmm, don't know this beast. But wouldn't it help, if Tramps >> sends initially "stty cooked"? >=20 > I've digged further. Likely, the problem can be avoided if we disable > command line editing of the shell. Tramp does it already if the remote > shell is zsh; I've added a similar parameter to the bash invocation. For > other shells, like ksh, I haven't found a simple parameter. >=20 > For that class of shells, I've added code which installs a temporary > ~/.editrc file, containing the line 'edit off'. >=20 > Could you please migrate to Tramp 2.4.3.1 from GNU ELPA? On top of this, > install the appended patch. >=20 > And pls report, whether it works for you. >=20 > Best regards, Michael. >=20 > Your change applied to tramp 2.4.3 from ELPA works. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 06 04:14:01 2020 Received: (at 39399-done) by debbugs.gnu.org; 6 Feb 2020 09:14:01 +0000 Received: from localhost ([127.0.0.1]:47062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izdEX-0000BP-E5 for submit@debbugs.gnu.org; Thu, 06 Feb 2020 04:14:01 -0500 Received: from mout.gmx.net ([212.227.17.20]:45555) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izdEU-0000Ay-QY for 39399-done@debbugs.gnu.org; Thu, 06 Feb 2020 04:13:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1580980429; bh=VJnbUQaeammOmnKzFE0tqZAhnjVETg3K+3NeBE0e3sU=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=XBVnGkiAnp0Hh1FaczTXmMmNt2lidMTu7OrU2dz85FjCa8qb1kDcSCnSmEfNAJ8UE l+6LwKUyRUQ9n+5VzpCN1ondoRdpnJ5q4yBbl30MY1IaoXPylwpQOWWf/QKy+msOC0 6sUlgUYk0TYs1M08k5SDTdrs96EPczzaD06yEJQw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from detlef.gmx.de ([212.86.42.94]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MG9g4-1ilLUn06k0-00GYW3; Thu, 06 Feb 2020 10:13:49 +0100 From: Michael Albinus To: John F Carr Subject: Re: bug#39399: tramp depends on unstable details of shell command line processing References: <87v9ooujwt.fsf@gmx.de> <87pneuvjhp.fsf@gmx.de> <7F7FAC1C-A532-4561-88D2-BAD17869C99E@exchange.mit.edu> Date: Thu, 06 Feb 2020 10:13:47 +0100 In-Reply-To: <7F7FAC1C-A532-4561-88D2-BAD17869C99E@exchange.mit.edu> (John F. Carr's message of "Wed, 5 Feb 2020 23:42:00 +0000") Message-ID: <87o8ucoz78.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:3AVzRkehbpkFW19GLIqEy5bELT0IaoRCAbJcUTNA1QALYGE7XXa jiyQkwT6r1G5irQcl5DOSjm7yujOrrS2JHjIwyX0S6rA1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8Wca2faLMOnw8yXAmjXJbTbr0e4WgoOHobRzr0UXr+Hz3srZJmEDClSLXIhjSlEl FSJbm4WeWSS95ksSpeOPPZ4hXUPX3MPnAXwZBD5tjDD5hiWK4PauuVkJXAoGD8LFMdlhjGCEc WMfiY2aOEb9ylzhZ1Qcy5qUqLtehwQge56d52yN3auokjqGhj+OjTmp1MCZWW/mE+ci74j+i0 0kuIOITQVl6XC43W8dXtD/r0jAyaf95DuYspDGtgPpXevopxHNwNoLsBUKeQUA6RAdz5kpVkz bV+PVWAJqVRZZeqtNv4Xu+4CeY8tq2d6xBdgLofWsqQox/Z8Tw23Ed3rZM7LDVUTZEiqL+3CM VHP2p9y2duxnoCoHg Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39399-done Cc: "39399@debbugs.gnu.org" <39399-done@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Version: 27.2 John F Carr writes: Hi John, >> I've digged further. Likely, the problem can be avoided if we disable >> command line editing of the shell. Tramp does it already if the remote >> shell is zsh; I've added a similar parameter to the bash invocation. Fo= r >> other shells, like ksh, I haven't found a simple parameter. >> >> For that class of shells, I've added code which installs a temporary >> ~/.editrc file, containing the line 'edit off'. >> >> Could you please migrate to Tramp 2.4.3.1 from GNU ELPA? On top of this= , >> install the appended patch. >> >> And pls report, whether it works for you. > > Your change applied to tramp 2.4.3 from ELPA works. Thanks for the feedback. Since I have no *BSD machine, I couldn't test the patch; it was rather a shot into the dark. I've pushed the patch, slightly modified, to the Emacs and Tramp repositories. It won't appear with Emacs 27.1, because it is too late to commit such serious changes so close to its release; but I will merge it into the emacs-27 codebase after Emacs 27.1 has been released. The next GNU ELPA Tramp release, 2.4.3.2, will carry this patch. It will appear in a couple of weeks. Best regards, Michael. From unknown Fri Jun 13 10:38:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 05 Mar 2020 12:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 26 23:50:39 2020 Received: (at control) by debbugs.gnu.org; 27 Jul 2020 03:50:39 +0000 Received: from localhost ([127.0.0.1]:53692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jzu9v-0004Gl-7O for submit@debbugs.gnu.org; Sun, 26 Jul 2020 23:50:39 -0400 Received: from mail-pl1-f172.google.com ([209.85.214.172]:39554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jzu9t-0004GX-Ne for control@debbugs.gnu.org; Sun, 26 Jul 2020 23:50:38 -0400 Received: by mail-pl1-f172.google.com with SMTP id b9so7300258plx.6 for ; Sun, 26 Jul 2020 20:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=iyDYCT/qzCYo8ETl2Bc39ttQkIgthxtIVU/jcl2SQ5c=; b=Lh5C7PL3EyUn8Y0zOwSCbAjDqvoy7CUj8icS7Ep4iVxQ/MsCxU1nLfcM/pg6JClyxg bkvtXz3T1Gi1on25xIVkWDKjKxSBLqgYIiPTLtvLC9GHtrCBwXKi+swErC49MXkFwMzJ 7O0Ks6OFpcDnmjoeKFLF45fo/xa8cIsghQ04SLIPGIa+FM7Ose96uJUKE9IVJRS6G2Kc HlArDqg+olf4lZQp9wFqGjKT2Zrv+BYRTQMp83/rtqMn2je7psNZx9C7JjAgXl+/f0U7 IMc8TKmE+PQhcV/Hx/aY4VmCRmMtA8OdoP5/h2ZaiMh+xawqQF1WSOiH2MuEElSizfqB oZIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=iyDYCT/qzCYo8ETl2Bc39ttQkIgthxtIVU/jcl2SQ5c=; b=CHX9M37KU9+kGHR5FbxTNF6+jV6bsW4RP4kGN7FBO6UgtHVg1A5sTpsV/aVJRoywUn ujFhrBxWfRB6kZsYHAC4sA0JLpRmG9Ov+JlJWRb5fta/4gRt7KdNGrkUcd/XiGhRt3YF bigvIZY6dLJP3rusU+6yltK/Po4E2HLhqs073p0/vIMs4wj1HGMgWfRX4kmIaryEFWzI lXCVFUlMAoC8t8b9jNsaI5vtwZPTmi1lpLqIB/UXUqoMCquyl25sfjqXyCIY8itTgCYf Kkc+x4kRH1urnlVCOqsc5atTzapD2RymAychOVKbaYkSG5X5J+aUOwDx2mzwNsHn3Hst Eh4Q== X-Gm-Message-State: AOAM533WACUKCsk2EX1zrmrpEBFFCAJAGfoSmoOrAyjzxvEYQEkvM/0X lHnNifdhEx30xk0js+ujzfEnFGAAmZY= X-Google-Smtp-Source: ABdhPJw1k5zVrj77oO3x+JPu47+kT9gRYbZTZEczONbgVA5VNcPJkDZ0nchNvVNdD4rHMlAdiaTt1g== X-Received: by 2002:a17:90a:c68e:: with SMTP id n14mr16163222pjt.182.1595821831285; Sun, 26 Jul 2020 20:50:31 -0700 (PDT) Received: from ?IPv6:2400:2410:3241:ef00:92:6c93:21:2aff? ([2400:2410:3241:ef00:92:6c93:21:2aff]) by smtp.gmail.com with ESMTPSA id q73sm2233908pjc.11.2020.07.26.20.50.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Jul 2020 20:50:30 -0700 (PDT) From: =?utf-8?B?5YaF6JekIOelkOS4gOmDjg==?= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: unarchive Message-Id: <9CC3F086-EB99-4319-AE74-DDD497054A6A@gmail.com> Date: Mon, 27 Jul 2020 12:50:28 +0900 To: control@debbugs.gnu.org X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) unarchive 39399 reopen 39399 From unknown Fri Jun 13 10:38:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug No longer marked as fixed in versions 27.2 and reopened. Date: Mon, 27 Jul 2020 03:51:01 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug No longer marked as fixed in versions 27.2 and reopened. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 27 00:12:33 2020 Received: (at 39399) by debbugs.gnu.org; 27 Jul 2020 04:12:33 +0000 Received: from localhost ([127.0.0.1]:53739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jzuV7-00070E-HW for submit@debbugs.gnu.org; Mon, 27 Jul 2020 00:12:33 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:39557) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jzuV5-000700-EO for 39399@debbugs.gnu.org; Mon, 27 Jul 2020 00:12:33 -0400 Received: by mail-pf1-f193.google.com with SMTP id z188so481099pfc.6 for <39399@debbugs.gnu.org>; Sun, 26 Jul 2020 21:12:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:message-id:date:to; bh=oXIarMdm9y2BTy21BtEb3UUwLJtxyA10FSvXQKKSBYg=; b=RLhgEnXLVtWMAacGh3nnIiSijcpBPB0zpIJO6nJ5wkP3H07v0irRVWX6nFjCf+BKO/ brtRROtVpLd0Q/JWpRqBwedyWc5lH9Hqu2fGRmcg7tYC7frB3M8epoujTCDR43wVFkY6 5rnzLgKwSOniSDU8Mi6N3VK2mfSE9LgGkplsyiABqc/1/IjgmE0K68psxCeyEIUNrYoV wr5KIzv6Ki9JFdyheuUlVwItHs/i++jPLhF9IR6dXhISReH/lU4GGyAyxmYvaXIz8KEC cUMkSCf9GXkJMxnu8LrDqDT/lVR3xEfWYBRMQgtyAg3uBgP6j4D4wNNBBH+BaBd1KZVe 1JvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=oXIarMdm9y2BTy21BtEb3UUwLJtxyA10FSvXQKKSBYg=; b=IgZXGdXCUSNKMaoYgCTj2hiRficOEX7ZF6TSgZb4sBDv/K/wcJtW+gtL/coR/yaTzt CgPp+Nl/MsoPOB+YzNQk1R/Z+2I2qsrxWl1iTzcLysAv+Er6Nt56GSGJ1+9AaJDfRZfE E8S4YcadkzeOMMhfkDnPcXjRsy3+o88p5Wb1UJAm4CFeF1V+tbJT1gVPkKl7+472BrMB Lp9FZMedAfX+BeqngbdPaj/DmyGHll//zYFWvQ1tzESOam0ux5/6wa40859TK34/rlVI NSDCa853tDlEWgEclERpg/yLZ5BZmyzt5gghBDSd3zRy4nj27hmG94jEMruTvMU55bEc y4Dg== X-Gm-Message-State: AOAM531O1sMhNhUgKkFzihah7lfsgHvlcDILzgul6d0WyTCDh7e9gfef uu8inxW5xoup2ZymNPba/VfEtj9/0so= X-Google-Smtp-Source: ABdhPJzEj4RoBwCWhY2fYfaaEunWBAcwS4uagDnEHNzEIePmXBxM+qJAzVRtmEufOttnt1X6sMWJ1A== X-Received: by 2002:a63:7f5d:: with SMTP id p29mr17960590pgn.259.1595823144918; Sun, 26 Jul 2020 21:12:24 -0700 (PDT) Received: from ?IPv6:2400:2410:3241:ef00:92:6c93:21:2aff? ([2400:2410:3241:ef00:92:6c93:21:2aff]) by smtp.gmail.com with ESMTPSA id b24sm12091604pgn.8.2020.07.26.21.12.23 for <39399@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Jul 2020 21:12:24 -0700 (PDT) From: =?utf-8?B?5YaF6JekIOelkOS4gOmDjg==?= Content-Type: multipart/mixed; boundary="Apple-Mail=_413909CC-1023-4135-8EE2-A4CDA3E7E447" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: tramp depends on unstable details of shell command line processing Message-Id: <78F0CA89-AE48-4E45-B03B-7C6AABE9FCAC@gmail.com> Date: Mon, 27 Jul 2020 13:12:21 +0900 To: 39399@debbugs.gnu.org X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 39399 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Apple-Mail=_413909CC-1023-4135-8EE2-A4CDA3E7E447 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi. I could find a another way to solve this problem that avoids changing = ~/.editrc and it's more simple. See my patch attached on this mail. This problem happens on the latest libedit and FreeBSD sh uses Emacs = edit mode by default. If libedit runs on edit mode, libedit rewrites line by each control = character. On '^H', libedit sends line feed and write characters on the line that = is held in the internal screen buffer of libedit. If edit mode turns off, line edit works on terminal that is as same as = previous behavior. Shell command `set +E` escapes from edit mode in spite of libedit has = two edit mode (Emacs and Vi). `set +E` disables both of them. Although libedit has been developed and used by NetBSD, NetBSD doesn=E2=80= =99t have this problem. Because NetBSD sh doesn't use edit mode by default. I could confirm my patch solves this problem on emacs-26.3. And also works to FreeBSD current & OpenBSD current & RedHat 7.8. =E2=80=94 Yuichiro NAITO naito.yuichiro@gmail.com --Apple-Mail=_413909CC-1023-4135-8EE2-A4CDA3E7E447 Content-Disposition: attachment; filename=tramp.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="tramp.patch" Content-Transfer-Encoding: 7bit diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 18ae295108..ee64b3b13d 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4059,6 +4059,7 @@ process to set up. VEC specifies the connection." ;; Disable echo expansion. (tramp-message vec 5 "Setting up remote shell environment") + (tramp-send-command vec "set +E" t) (tramp-send-command vec "stty -inlcr -onlcr -echo kill '^U' erase '^H'" t) ;; Check whether the echo has really been disabled. Some --Apple-Mail=_413909CC-1023-4135-8EE2-A4CDA3E7E447 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail=_413909CC-1023-4135-8EE2-A4CDA3E7E447-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 27 14:02:08 2020 Received: (at 39399) by debbugs.gnu.org; 27 Jul 2020 18:02:08 +0000 Received: from localhost ([127.0.0.1]:55663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k07Rv-0000SD-S1 for submit@debbugs.gnu.org; Mon, 27 Jul 2020 14:02:08 -0400 Received: from mout.gmx.net ([212.227.17.22]:57951) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k07Rt-0000Rh-Kr for 39399@debbugs.gnu.org; Mon, 27 Jul 2020 14:02:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1595872919; bh=gF2EDX5ZeU4404OTLAgpjJTO4Drja6+idz34nmrlEnI=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=Ltlzv25CBIUSUkVBkoOd2WKjhA2NxQP74u2B6zLPO5vOMvhZAEq3EGn27+rVEO4rO KE8eJ7TIZCKZ/3eWt3Q15LMFr5Z1LAP+nC4daG+YMvwNG4QaJQARBFoVBaDFm0Elum BeZoGKOFct5QYdz555kZ6kRAKgX6hAmv4TE2Kejw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([212.86.42.3]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MPokN-1kCXn33Mfb-00MtTM; Mon, 27 Jul 2020 20:01:58 +0200 From: Michael Albinus To: =?utf-8?B?5YaF6JekIOelkOS4gOmDjg==?= Subject: Re: bug#39399: tramp depends on unstable details of shell command line processing References: <78F0CA89-AE48-4E45-B03B-7C6AABE9FCAC@gmail.com> Date: Mon, 27 Jul 2020 20:01:57 +0200 In-Reply-To: <78F0CA89-AE48-4E45-B03B-7C6AABE9FCAC@gmail.com> (=?utf-8?B?IuWGheiXpCDnpZDkuIDpg44iJ3M=?= message of "Mon, 27 Jul 2020 13:12:21 +0900") Message-ID: <87lfj4omzu.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:OgJGOt3LJVcE3xO71LmGhBabDCDY2vttIe0hjWcYpUCRpCrRt1H tEuxNarUO+J1jZQvSfMWMbweOdJ8AcSS+almZpB3qCjzewzp0MQ6r5wDwB2zJ8/rb2gHneY YDLyjlbDa7MwEZNe2FR9VS+EJA3PN34WhwJC/JXuoWabATy4h1eqfgFe+HTCo6fPyzXhFn2 9obci7b42Fju309KqPHzQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:K5M3Qpxdm3M=:Ihj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/O6fXqSR5ijQqF4RI4/hC59qmJmMGBtXsC/WXQG+pW0U7 FyDdR+offT6pwGq3JMiLDJ2xNIEqfNjWFFPm9UbEmmrBL7BueRR0mSmx9/tMt+j/TpQAqgbki TCrLHD40TOgBqX+C5K3dyho9mdQrAyB6+eh7MSRUz1X3X7rL1eY+DM8fLs0PNPRNLPz7QXjdI kheCDSrNis2csudCmbN7X7gXd8zFK2H8flr4F3w== X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 39399 Cc: 39399@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =E5=86=85=E8=97=A4 =E7=A5=90=E4=B8=80=E9=83=8E w= rites: > Hi. Hi, > I could find a another way to solve this problem that avoids changing > ~/.editrc and it's more simple. > See my patch attached on this mail. > > This problem happens on the latest libedit and FreeBSD sh uses Emacs > edit mode by default. > > If libedit runs on edit mode, libedit rewrites line by each control chara= cter. > On '^H', libedit sends line feed and write characters on the line that > is held in the internal screen buffer of libedit. > > If edit mode turns off, line edit works on terminal that is as same as > previous behavior. > > Shell command `set +E` escapes from edit mode in spite of libedit has > two edit mode (Emacs and Vi). `set +E` disables both of them. > > Although libedit has been developed and used by NetBSD, NetBSD doesn=E2= =80=99t > have this problem. > Because NetBSD sh doesn't use edit mode by default. Thanks for the report. However, your patch is not applicable in general, because the "+E" option is not POSIX conform, and it isn't supported by all shells. I thought already about this when I was fixing bug#39399. But wait - "set +o emacs +o vi" might give the same effect, and it is much more supported by shells. And reading the sources, Tramp calls it already (might have been added by Kai, many years ago). Maybe it is sufficient to move it earlier in the initialization machinery? Appended is a patch for Tramp 2.4.4. You might install it from GNU ELPA. Please check, whether this works for you. > Yuichiro NAITO > naito.yuichiro@gmail.com Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable *** /tmp/ediffbojDZA 2020-07-27 19:49:26.025530831 +0200 =2D-- /home/albinus/src/tramp-2-4-stable/lisp/tramp-sh.el 2020-07-27 19:38= :04.853551455 +0200 *************** *** 4104,4183 **** (defun tramp-open-shell (vec shell) "Open shell SHELL." (with-tramp-progress-reporter vec 5 (format-message "Opening remote shell `%s'" shell) ! ;; Find arguments for this shell. ! (let ((extra-args (tramp-get-sh-extra-args shell)) ! (p (tramp-get-connection-process vec))) ! ;; The readline library can disturb Tramp. For example, the ! ;; very recent version of libedit, the *BSD implementation of ! ;; readline, confuses Tramp. So we disable line editing. Since ! ;; $EDITRC is not supported on all target systems, we must move ! ;; ~/.editrc temporarily somewhere else. For bash and zsh we ! ;; have disabled this already during shell invocation, see ! ;; `tramp-sh-extra-args' (Bug#39399). ! ;; The shell prompt might not be set yet, so we must read any ! ;; prompt via `tramp-barf-if-no-shell-prompt'. ! (unless extra-args ! (tramp-send-command vec "rm -f ~/.editrc.tramp" t t) ! (tramp-barf-if-no-shell-prompt p 10 "Couldn't find remote shell prompt"= ) ! (tramp-send-command ! vec "test -e ~/.editrc && mv -f ~/.editrc ~/.editrc.tramp" t t) ! (tramp-barf-if-no-shell-prompt p 10 "Couldn't find remote shell prompt"= ) ! (tramp-send-command vec "echo 'edit off' >~/.editrc" t t) ! (tramp-barf-if-no-shell-prompt ! p 10 "Couldn't find remote shell prompt")) ! ;; It is useful to set the prompt in the following command ! ;; because some people have a setting for $PS1 which /bin/sh ! ;; doesn't know about and thus /bin/sh will display a strange ! ;; prompt. For example, if $PS1 has "${CWD}" in the value, then ! ;; ksh will display the current working directory but /bin/sh ! ;; will display a dollar sign. The following command line sets ! ;; $PS1 to a sane value, and works under Bourne-ish shells as ! ;; well as csh-like shells. We also unset the variable $ENV ! ;; because that is read by some sh implementations (eg, bash ! ;; when called as sh) on startup; this way, we avoid the startup ! ;; file clobbering $PS1. $PROMPT_COMMAND is another way to set ! ;; the prompt in /bin/bash, it must be discarded as well. ! ;; $HISTFILE is set according to `tramp-histfile-override'. ! ;; $TERM and $INSIDE_EMACS set here to ensure they have the ! ;; correct values when the shell starts, not just processes ! ;; run within the shell. (Which processes include our ! ;; initial probes to ensure the remote shell is usable.) ! (tramp-send-command ! vec (format ! (eval-when-compile ! (concat ! "exec env TERM=3D'%s' INSIDE_EMACS=3D'%s,tramp:%s' " ! "ENV=3D%s %s PROMPT_COMMAND=3D'' PS1=3D%s PS2=3D'' PS3=3D'' %s %= s")) ! tramp-terminal-type ! emacs-version tramp-version ; INSIDE_EMACS ! (or (getenv-internal "ENV" tramp-remote-process-environment)= "") ! (if (stringp tramp-histfile-override) ! (format "HISTFILE=3D%s" ! (tramp-shell-quote-argument tramp-histfile-override)) ! (if tramp-histfile-override ! "HISTFILE=3D'' HISTFILESIZE=3D0 HISTSIZE=3D0" ! "")) ! (tramp-shell-quote-argument tramp-end-of-output) ! shell (or extra-args "")) ! t) ! ;; Reset ~/.editrc. ! (unless extra-args ! (tramp-send-command vec "rm -f ~/.editrc" t) ! (tramp-send-command ! vec "test -e ~/.editrc.tramp && mv -f ~/.editrc.tramp ~/.editrc" t)) ! ;; Check proper HISTFILE setting. We give up when not working. ! (when (and (stringp tramp-histfile-override) ! (file-name-directory tramp-histfile-override)) ! (tramp-barf-unless-okay ! vec ! (format ! "(cd %s)" ! (tramp-shell-quote-argument ! (file-name-directory tramp-histfile-override))) ! "`tramp-histfile-override' uses invalid file `%s'" ! tramp-histfile-override))) (tramp-set-connection-property (tramp-get-connection-process vec) "remote-shell" shell))) =2D-- 4104,4157 ---- (defun tramp-open-shell (vec shell) "Open shell SHELL." + ;; Find arguments for this shell. (with-tramp-progress-reporter vec 5 (format-message "Opening remote shell `%s'" shell) ! ;; It is useful to set the prompt in the following command because ! ;; some people have a setting for $PS1 which /bin/sh doesn't know ! ;; about and thus /bin/sh will display a strange prompt. For ! ;; example, if $PS1 has "${CWD}" in the value, then ksh will ! ;; display the current working directory but /bin/sh will display ! ;; a dollar sign. The following command line sets $PS1 to a sane ! ;; value, and works under Bourne-ish shells as well as csh-like ! ;; shells. We also unset the variable $ENV because that is read ! ;; by some sh implementations (eg, bash when called as sh) on ! ;; startup; this way, we avoid the startup file clobbering $PS1. ! ;; $PROMPT_COMMAND is another way to set the prompt in /bin/bash, ! ;; it must be discarded as well. $HISTFILE is set according to ! ;; `tramp-histfile-override'. $TERM and $INSIDE_EMACS set here to ! ;; ensure they have the correct values when the shell starts, not ! ;; just processes run within the shell. (Which processes include ! ;; our initial probes to ensure the remote shell is usable.) ! (tramp-send-command ! vec (format ! (eval-when-compile ! (concat ! "exec env TERM=3D'%s' INSIDE_EMACS=3D'%s,tramp:%s' " ! "ENV=3D%s %s PROMPT_COMMAND=3D'' PS1=3D%s PS2=3D'' PS3=3D'' %s %s"= )) ! tramp-terminal-type ! emacs-version tramp-version ; INSIDE_EMACS ! (or (getenv-internal "ENV" tramp-remote-process-environment) "= ") ! (if (stringp tramp-histfile-override) ! (format "HISTFILE=3D%s" ! (tramp-shell-quote-argument tramp-histfile-override)) ! (if tramp-histfile-override ! "HISTFILE=3D'' HISTFILESIZE=3D0 HISTSIZE=3D0" ! "")) ! (tramp-shell-quote-argument tramp-end-of-output) ! shell (or (tramp-get-sh-extra-args shell) "")) ! t) ! ;; Check proper HISTFILE setting. We give up when not working. ! (when (and (stringp tramp-histfile-override) ! (file-name-directory tramp-histfile-override)) ! (tramp-barf-unless-okay ! vec ! (format ! "(cd %s)" ! (tramp-shell-quote-argument ! (file-name-directory tramp-histfile-override))) ! "`tramp-histfile-override' uses invalid file `%s'" ! tramp-histfile-override)) (tramp-set-connection-property (tramp-get-connection-process vec) "remote-shell" shell))) *************** *** 4248,4256 **** (let ((tramp-end-of-output tramp-initial-end-of-output) (case-fold-search t)) (tramp-open-shell vec (tramp-get-method-parameter vec 'tramp-remote-= shell)) ;; Disable echo expansion. - (tramp-message vec 5 "Setting up remote shell environment") (tramp-send-command vec "stty -inlcr -onlcr -echo kill '^U' erase '^H'" t) ;; Check whether the echo has really been disabled. Some =2D-- 4222,4233 ---- (let ((tramp-end-of-output tramp-initial-end-of-output) (case-fold-search t)) (tramp-open-shell vec (tramp-get-method-parameter vec 'tramp-remote-= shell)) + (tramp-message vec 5 "Setting up remote shell environment") + + ;; Disable line editing. + (tramp-send-command vec "set +o vi +o emacs" t) ;; Disable echo expansion. (tramp-send-command vec "stty -inlcr -onlcr -echo kill '^U' erase '^H'" t) ;; Check whether the echo has really been disabled. Some *************** *** 4320,4327 **** (tramp-message vec 5 "Setting coding system to `%s' and `%s'" cs-decode cs-encode))) - (tramp-send-command vec "set +o vi +o emacs" t) - ;; Check whether the remote host suffers from buggy ;; `send-process-string'. This is known for FreeBSD (see comment ;; in `send_process', file process.c). I've tested sending 624 =2D-- 4297,4302 ---- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 27 22:51:53 2020 Received: (at 39399) by debbugs.gnu.org; 28 Jul 2020 02:51:53 +0000 Received: from localhost ([127.0.0.1]:56593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k0Fib-0003KL-E5 for submit@debbugs.gnu.org; Mon, 27 Jul 2020 22:51:53 -0400 Received: from mail-pl1-f170.google.com ([209.85.214.170]:39162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k0FiZ-0003K0-Ke for 39399@debbugs.gnu.org; Mon, 27 Jul 2020 22:51:52 -0400 Received: by mail-pl1-f170.google.com with SMTP id b9so9144414plx.6 for <39399@debbugs.gnu.org>; Mon, 27 Jul 2020 19:51:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=MuSOfMwVzoQ2SjSOgZMk4Mc1cmrEqJySEqNOZfJ+P2w=; b=qI7O/OHNVRBS5rJTFEW/4dmiOeyi21UxuMCN4f9TCamza3/wpo5giNqzMW57FSIWca GZBK4f3yK426R/rmlsEHuizkLuM0P5zsUwajFp0pMVcV9M0p8lPuyAjvo+sDT77u0RTq Wh7OgrgKFm7OaQyx3VSMBellKNjQ0SLJ2XVN5oCiu3Ubtu7kZGvySrSNS1T0c6+vCYG0 JlDpvKMiCjIUwc1GgI/dFaDEFt+4mQd+jRIb+5+P/5bd70PZXv81us2XUyMToi2reGZq /YUd+/PKVfibqmSQm7dIom7u2fkSqsnXDhpL/GIfEVUutSnzIcrQ+Pm6XsHjI9FKJyQ1 TD1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=MuSOfMwVzoQ2SjSOgZMk4Mc1cmrEqJySEqNOZfJ+P2w=; b=Gwfzgi5OP9tiooBxZq4dzR/eogmqjl0rFYr44du86uNK08L37I/zmsv5bYwiUhw3zr /QYQPx7d5G/zdaSKj0Ee5VBglzVkHEdsIJAdEVPw5qCCoO5i/X+FxejuhWt+MTX09O6w 6T3upbYZlQ6+IadBiJ0aa5fws0k6WzrpXYy+gKIIcdhjIhaylRAAYibJo3LT6ULNfFD3 o/h3nFukOMEn5yTgJn85KXML8xBi9XfJTIvmFmJlu/cpGflL+KXo8y4IvmE4EBQjD0P2 v5ib8HhNDS5UmhPaqb/HBWt/zjeCp7ZdhrUr5iRPKG2oWNZkxBYGoB0M1DgTR7JkKFoj 7nMQ== X-Gm-Message-State: AOAM531avhX3USsK/tMuaLafVFAt8PonpzUi0UV0lFycAsD5Cn5vHyVN 8Bj7ffxmA+579ZM0uka/DMU= X-Google-Smtp-Source: ABdhPJwecg3BhLuQH6SxJHPXJm9V0uOPDbtsuWmgvu1ZuIu9C+Ifcws2nHBEWBKvvqlulO/0KRHPVg== X-Received: by 2002:a17:90a:4682:: with SMTP id z2mr2286543pjf.34.1595904705604; Mon, 27 Jul 2020 19:51:45 -0700 (PDT) Received: from ?IPv6:2400:2410:3241:ef00:92:6c93:21:2aff? ([2400:2410:3241:ef00:92:6c93:21:2aff]) by smtp.gmail.com with ESMTPSA id d9sm16790898pgv.45.2020.07.27.19.51.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jul 2020 19:51:44 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: bug#39399: tramp depends on unstable details of shell command line processing From: =?utf-8?B?5YaF6JekIOelkOS4gOmDjg==?= In-Reply-To: <87lfj4omzu.fsf@gmx.de> Date: Tue, 28 Jul 2020 11:51:42 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: References: <78F0CA89-AE48-4E45-B03B-7C6AABE9FCAC@gmail.com> <87lfj4omzu.fsf@gmx.de> To: Michael Albinus X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 39399 Cc: 39399@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Thanks for the reply. > 2020/07/28 3:01=E3=80=81Michael Albinus = =E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB: >> I could find a another way to solve this problem that avoids changing >> ~/.editrc and it's more simple. >> See my patch attached on this mail. >>=20 >> This problem happens on the latest libedit and FreeBSD sh uses Emacs >> edit mode by default. >>=20 >> If libedit runs on edit mode, libedit rewrites line by each control = character. >> On '^H', libedit sends line feed and write characters on the line = that >> is held in the internal screen buffer of libedit. >>=20 >> If edit mode turns off, line edit works on terminal that is as same = as >> previous behavior. >>=20 >> Shell command `set +E` escapes from edit mode in spite of libedit has >> two edit mode (Emacs and Vi). `set +E` disables both of them. >>=20 >> Although libedit has been developed and used by NetBSD, NetBSD = doesn=E2=80=99t >> have this problem. >> Because NetBSD sh doesn't use edit mode by default. >=20 > Thanks for the report. However, your patch is not applicable in = general, > because the "+E" option is not POSIX conform, and it isn't supported = by > all shells. I thought already about this when I was fixing bug#39399. >=20 > But wait - "set +o emacs +o vi" might give the same effect, and it is > much more supported by shells. And reading the sources, Tramp calls it > already (might have been added by Kai, many years ago). Maybe it is > sufficient to move it earlier in the initialization machinery? Exactly yes it is! =E2=80=9C set +o emacs +o vi=E2=80=9D works as same as =E2=80=9Cset = +E=E2=80=9D on FreeBSD sh. Tramp-mode hung before it, so it was not executed. > Appended is a patch for Tramp 2.4.4. You might install it from GNU > ELPA. Please check, whether this works for you. The appended patch works for me. But I think just moving "set +o emacs +o vi=E2=80=9D before =E2=80=9Cstty = =E2=80=A6=E2=80=9D is more simple way. =E2=80=94 Yuichiro NAITO naito.yuichiro@gmail.com From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 28 03:34:50 2020 Received: (at 39399-done) by debbugs.gnu.org; 28 Jul 2020 07:34:50 +0000 Received: from localhost ([127.0.0.1]:57102 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k0K8P-0001xL-P1 for submit@debbugs.gnu.org; Tue, 28 Jul 2020 03:34:49 -0400 Received: from mout.gmx.net ([212.227.17.20]:53709) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k0K8L-0001x4-NH for 39399-done@debbugs.gnu.org; Tue, 28 Jul 2020 03:34:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1595921677; bh=R+v6f0ojnAqfF/cxzH6IGK89eLrS0eEHJ4akiogTm4g=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=SB+h69f09DNTAxS72r0WyZ+x7/GVAf/ym45nvM22u6C9PSovc7lY2ejxRY9ek0Rsm T6gc/qQjsibXlYZi4RLArmaH8VpAlwoxeHsD6eEA3q7m6Y0/4qyjxDh7IpKYm0umn+ CHc27uCMvclE78f61Lxh4LzRc2fU+zLWZBr9F4uo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([212.86.42.3]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N4hzj-1kxowk0moB-011lqD; Tue, 28 Jul 2020 09:34:37 +0200 From: Michael Albinus To: =?utf-8?B?5YaF6JekIOelkOS4gOmDjg==?= Subject: Re: bug#39399: tramp depends on unstable details of shell command line processing References: <78F0CA89-AE48-4E45-B03B-7C6AABE9FCAC@gmail.com> <87lfj4omzu.fsf@gmx.de> Date: Tue, 28 Jul 2020 09:34:36 +0200 In-Reply-To: (=?utf-8?B?IuWGheiXpCDnpZDkuIDpg44iJ3M=?= message of "Tue, 28 Jul 2020 11:51:42 +0900") Message-ID: <87h7tsnldf.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Y5Y792rSatqje99D8BX1iGAfbY/PcFRd05p0pZ6wVsHiDTeN3cC JIuVywe9RpsVyYbFLj7QFeEdmM306iEbgLkaH1HQKsmT723Oc+wNKLc8urdAaGk6smb/QNv mLOE6Dn25DhCNkGIDqEir1S0e3aOhA/xjnmQafaBIBPg1QBHtgwaU5/+suTxcvKsbXK73Hr tA2rIYgvOdDnbqq14jXmw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:mn7DF8oqLd0=:v9qHCntBT1FFtneUwVld2h dZI7UBHMCS3h9FZlRU1okaX3mlLiZhwOHIr1hd6oZCxlHjmotK9UwId4U8IO+1pyKa4px8xLb 0ioYT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vrgZCdzkZ2RVfKBXYkFdAaJcXPnj3suAoZqRot j4M1OTJKnmk3nsGBkplc0PGsqMkix0Lt6R4GYZgugq1iPWKs1quANCAH2UeDW0LGIpd+o5J4q rWOgcPAGSwwoiEJGaEgJaYWrQi/6GCgMuUMKEgQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39399-done Cc: John F Carr , 39399-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) =E5=86=85=E8=97=A4 =E7=A5=90=E4=B8=80=E9=83=8E w= rites: Hi, >> Appended is a patch for Tramp 2.4.4. You might install it from GNU >> ELPA. Please check, whether this works for you. > > The appended patch works for me. > But I think just moving "set +o emacs +o vi=E2=80=9D before =E2=80=9Cstty= =E2=80=A6=E2=80=9D is more simple way. Thanks for the feedback. In fact, the patch does exactly this: moving up the "set +o emacs +o vi=E2=80=9D command. The rest of the patch removes the handling of "~/.editrc", which was added as first attempt to solve this bug, and which isn't needed anymore. @John, I've Cc'ed you that you can check whether the changed fix still works for you. I'm closing this bug, again. The patch has been committed to the repositories. Tramp 2.4.4.1, planned to be released later this week on GNU ELPA, will contain it. Furthermore, this patch will also be in Emacs 27.2. For Emacs 27.1 it's too late to commit. > Yuichiro NAITO Best regards, Michael. From unknown Fri Jun 13 10:38:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 25 Aug 2020 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator