From unknown Tue Aug 19 21:02:42 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#8089 <8089@debbugs.gnu.org> To: bug#8089 <8089@debbugs.gnu.org> Subject: Status: Eshell remote files fix (patch) Reply-To: bug#8089 <8089@debbugs.gnu.org> Date: Wed, 20 Aug 2025 04:02:42 +0000 retitle 8089 Eshell remote files fix (patch) reassign 8089 emacs submitter 8089 Seppo Sade severity 8089 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 15:08:56 2011 Received: (at submit) by debbugs.gnu.org; 20 Feb 2011 20:08:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PrFaR-0005qi-UB for submit@debbugs.gnu.org; Sun, 20 Feb 2011 15:08:56 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PrFVv-0005kI-Gi for submit@debbugs.gnu.org; Sun, 20 Feb 2011 15:04:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrFVp-00038T-8G for submit@debbugs.gnu.org; Sun, 20 Feb 2011 15:04:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:51670) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrFVo-00037p-DD for submit@debbugs.gnu.org; Sun, 20 Feb 2011 15:04:09 -0500 Received: from [140.186.70.92] (port=47327 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrFVj-0001PL-IT for bug-gnu-emacs@gnu.org; Sun, 20 Feb 2011 15:04:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrFUV-0002rg-7f for bug-gnu-emacs@gnu.org; Sun, 20 Feb 2011 15:02:48 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:47805) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrFUV-0002r8-0h for bug-gnu-emacs@gnu.org; Sun, 20 Feb 2011 15:02:47 -0500 Received: by wyi11 with SMTP id 11so347465wyi.0 for ; Sun, 20 Feb 2011 12:02:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=t0ljs757oU7F0bXIaWQl1enbU2ADCPe/z8VPYYiSDgo=; b=JEfdZaP1OhBXPwMUDiZtysVmYtY61HShCZz/Rlo9UD3lYcLb0zcy8TN4CgkGCyrzl8 P1k+37M9tVLqZINGWWi4WZcS/GRi4z9poUtob0xMYjvqz2W7tM0uJ32tbDHURf2h9BFH utOMRIdcCSCx6Fgsvm+01eW/xEKQYDvQ0o1tY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=cGF+HQ7d4VrRKGzlQ2RW9xLZUsUeR5DIMuCqPDVBf4MQ0fF09CyVTdo4mXoJ0O+7L6 eOzXsrQdUi/J4qEC3hffuAi91ZiUTzDAJCLMNCRSoD/ytop35JH7YbzOo/IkMyYbcuDK H7hwzWM3vZcam/4RH2i6jt6BsUWdyLmHMXL1s= MIME-Version: 1.0 Received: by 10.227.152.197 with SMTP id h5mr481224wbw.78.1298232165493; Sun, 20 Feb 2011 12:02:45 -0800 (PST) Received: by 10.227.11.142 with HTTP; Sun, 20 Feb 2011 12:02:45 -0800 (PST) Date: Sun, 20 Feb 2011 22:02:45 +0200 Message-ID: Subject: Eshell remote files fix (patch) From: Seppo Sade To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=0016364ef5d20f6c33049cbc3be4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 20 Feb 2011 15:08:54 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) --0016364ef5d20f6c33049cbc3be4 Content-Type: text/plain; charset=ISO-8859-1 The following currently fails in Eshell: $ sudo bzgrep # Or any shell script in PATH /bin/sh: /sudo:root@localhost:/usr/bin/bzgrep: No such file or directory This is apparently so because eshell/sudo translates that to a Tramp remote location, but eshell-external-command fails to handle it as a remote command. It instead passes the default-directory containing Tramp syntax directly to the command (shell script), which obviously fails as it doesn't understand Tramp syntax. The patch below fixes this issue. (Was there any specific reason for earlier only considering "ftp" being remote, instead of all Tramp methods?) --- esh-ext.el.orig 2011-02-18 20:57:50.000000000 +0200 +++ esh-ext.el 2011-02-18 20:58:12.000000000 +0200 @@ -203,7 +203,7 @@ (defun eshell-external-command (command args) "Insert output from an external COMMAND, using ARGS." (setq args (eshell-stringify-list (eshell-flatten-list args))) - (if (string-equal (file-remote-p default-directory 'method) "ftp") + (if (file-remote-p default-directory) (eshell-remote-command command args)) (let ((interp (eshell-find-interpreter command))) (assert interp) --0016364ef5d20f6c33049cbc3be4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
The following currently f= ails in Eshell:

$ sudo bzgrep # Or any shell = script in PATH
/bin/sh: /sudo:root@localhost:/usr/bin/bzgrep: No such file or directo= ry

This is apparently so because eshell/sudo= translates that to a Tramp remote location, but eshell-external-command fa= ils to handle it as a remote command. It instead passes the default-directo= ry containing Tramp syntax directly to the command (shell script), which ob= viously fails as it doesn't understand Tramp syntax.=A0The patch below = fixes this issue. (Was there any specific reason for earlier only consideri= ng "ftp" being remote, instead of all Tramp methods?)

--- esh-ext.el.orig =A0 =A0 2011-02-18 20:57:50.0000000= 00 +0200
+++ esh-ext.el =A02011-02-18 20:58:12.000000000 +02= 00
@@ -203,7 +203,7 @@
=A0(defun eshell-external-comman= d (command args)
=A0=A0 "Insert output from an external COMMAND, using ARGS."=
=A0=A0 (setq args (eshell-stringify-list (eshell-flatten-list ar= gs)))
- =A0(if (string-equal (file-remote-p default-directory = 9;method) "ftp")
+ =A0(if (file-remote-p default-directory)
=A0=A0 =A0 =A0 (e= shell-remote-command command args))
=A0=A0 (let ((interp (eshell-= find-interpreter command)))
=A0=A0 =A0 (assert interp)

--0016364ef5d20f6c33049cbc3be4-- From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 22 00:54:56 2011 Received: (at 8089-done) by debbugs.gnu.org; 22 Feb 2011 05:54:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PrlD5-0000gF-Tr for submit@debbugs.gnu.org; Tue, 22 Feb 2011 00:54:56 -0500 Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PrlD3-0000g0-TZ for 8089-done@debbugs.gnu.org; Tue, 22 Feb 2011 00:54:55 -0500 Received: (qmail invoked by alias); 22 Feb 2011 05:54:47 -0000 Received: from p57BB9684.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [87.187.150.132] by mail.gmx.net (mp002) with SMTP; 22 Feb 2011 06:54:47 +0100 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX19FwXR78hxFsfNz+DHdFAPHfhXWkMh2osJmVj3oBj 0i4EN3xW9/t8TZ From: Michael Albinus To: Seppo Sade Subject: Re: bug#8089: Eshell remote files fix (patch) References: Date: Tue, 22 Feb 2011 06:54:45 +0100 In-Reply-To: (Seppo Sade's message of "Sun, 20 Feb 2011 22:02:45 +0200") Message-ID: <87fwrgr4uy.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Y-GMX-Trusted: 0 X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 8089-done Cc: 8089-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) Seppo Sade writes: > The following currently fails in Eshell: > > $ sudo bzgrep # Or any shell script in PATH > /bin/sh: /sudo:root@localhost:/usr/bin/bzgrep: No such file or > directory > > This is apparently so because eshell/sudo translates that to a Tramp > remote location, but eshell-external-command fails to handle it as a > remote command. It instead passes the default-directory containing > Tramp syntax directly to the command (shell script), which obviously > fails as it doesn't understand Tramp syntax.=C2=A0The patch below fixes > this issue. Thanks for the report. I've applied your patch to the trunk (aka Emacs 24). > (Was there any specific reason for earlier only considering "ftp" > being remote, instead of all Tramp methods?) Historical reasons. Originally, eshell used ange-ftp for remote connections. Best regards, Michael. From unknown Tue Aug 19 21:02:42 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, 22 Mar 2011 11:24:04 +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