From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Xiaoyue Chen Newsgroups: gmane.emacs.bugs Subject: bug#67126: eshell breaking tramp-remote-path Date: Sun, 12 Nov 2023 08:52:00 +0000 (UTC) Message-ID: <87y1f3s6a9.fsf@vvvu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22782"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.10.7; emacs 29.1.90 To: 67126@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 12 11:11:54 2023 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 1r27Ra-0005kJ-B7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Nov 2023 11:11:54 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r27R7-0000n4-Jy; Sun, 12 Nov 2023 05:11:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r27R4-0000mh-Kh for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2023 05:11:24 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r27R3-0004gC-EF for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2023 05:11:22 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r27Rh-0005yy-QR for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2023 05:12:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Xiaoyue Chen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Nov 2023 10:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67126 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169978388722936 (code B ref -1); Sun, 12 Nov 2023 10:12:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Nov 2023 10:11:27 +0000 Original-Received: from localhost ([127.0.0.1]:55135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r27R7-0005xp-0l for submit@debbugs.gnu.org; Sun, 12 Nov 2023 05:11:26 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:37754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r26D6-0001JB-FZ for submit@debbugs.gnu.org; Sun, 12 Nov 2023 03:53:00 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r26CL-0004tT-0j for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2023 03:52:05 -0500 Original-Received: from wrqvqsbb.outbound-mail.sendgrid.net ([149.72.70.187]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r26CI-0000vE-Mm for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2023 03:52:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vvvu.org; h=from:subject:mime-version:to:content-type:cc:content-type:from: subject:to; s=s1; bh=2okkmloh62L7XsVq+fe6x04I8fByVXvntNB2avO8oAs=; b=n2Zh1xqlpUXSLRVxTZsn/Am8xiGkNL7rXGzWy8TC+corOSGW9yltkhj9GcvxFNmwcw0l i8qGGAFQuiU7BLSDewTCcTNk2ZszyE0+bZwf90wENlvwnh30DqbiKWZ7k8QFo5UPDdc5ex uQS3scrJGp83AdTu8XdBzPWjz/Qrvz/V40QsQo9cAftNMPowkt8L97nyg/PQmu7c0AbCGu DtSw9rR3kG+4Y7eDCeMSGrix4QqWWQjuJGzfO6UAJdpg/Qbg0kLWnuERxoFsJlW5N83hY0 A5D2LdtpvMP38CHbTEmVjJFSqB4MGR+WsSdaewM1p6p5pya1l7v1bGkjybejq1Xg== Original-Received: by filterdrecv-6b68c9f446-ds7qt with SMTP id filterdrecv-6b68c9f446-ds7qt-1-65509230-A 2023-11-12 08:52:00.504000984 +0000 UTC m=+2211064.423717637 Original-Received: from racc (unknown) by geopod-ismtpd-4 (SG) with ESMTP id V062ytKdR8SAf4gkoOFNWg for ; Sun, 12 Nov 2023 08:52:00.048 +0000 (UTC) X-SG-EID: KIfOfgAJO7LiLJqGo05KETICuPS4rGc+DADhp2SRn/5/J9TdeqdaZyduAWIGdVR81sYxdmrE3rqeaP6kZP4fQHqptGz8zwiMnJ1ht/hrnkq4OWFkhuvpIq263CU5+8SVhSR7UA2FB2bxdp+zCKO5ayIjQcBclnrUV7IyDR9cBqVTQwbkTLumzEOGR5BtoydbT5xg2CGmq/53nRmHJpxI6j1I9KDuwCPZvJLDuBtD0uZhF4LzJjD6vUAl/2Ol7yY+ X-Entity-ID: nX7yxtGGIkTtStmrUMuIyA== Received-SPF: pass client-ip=149.72.70.187; envelope-from=bounces+34750365-1c7d-bug-gnu-emacs=gnu.org@em745.vvvu.org; helo=wrqvqsbb.outbound-mail.sendgrid.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 12 Nov 2023 05:11:23 -0500 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:274193 Archived-At: --=-=-= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Tags: patch Hello, Commit 2af092741e5 broke tramp-remote-path, making eshell unusable for sudo, ssh, etc. So any emacs version after that is effected. I found the issue on emacs 29.1.90. Steps to reproduce: 1. emacs -Q 2. Evaluate the following (require 'eshell) (add-to-list 'eshell-modules-list 'eshell-tramp) (require 'tramp) (add-to-list 'tramp-remote-path 'tramp-own-remote-path) 3. M-x eshell 4. Type "sudo uname" and press Enter 5. The output is erroneous sh: /home/xchen/env: No such file or directory ///374ad82e298d0a7279e9e4c98722b9f5#$ The cause is a minor error in eshell-gather-process-output (when (file-remote-p default-directory) (push (concat "PATH=" real-path) process-environment) (setq tramp-remote-path (eshell-get-path))) tramp-remote-path should not contain the remote part of the directories, so use (eshell-get-path t) fixes it. Attached is a simple patch to fix this issue. /Xiaoyue In GNU Emacs 29.1.90 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars) Repository revision: emacs-29.1.90 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101008 System Description: NixOS 23.11 (Tapir) Configured using: 'configure --prefix=/nix/store/0hkpjpd4nh282znb7z225iramjcgrv0n-emacs-unstable-29.1.90 --disable-build-details --with-modules --with-x-toolkit=lucid --with-xft --with-cairo --with-native-compilation --with-tree-sitter' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=eshell.patch diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el index 6561561440e..e7e91f08741 100644 --- a/lisp/eshell/esh-proc.el +++ b/lisp/eshell/esh-proc.el @@ -304,7 +304,7 @@ Used only on systems which do not support async subprocesses.") ;; future, remember to remove `tramp-remote-path' above, too.) (when (file-remote-p default-directory) (push (concat "PATH=" real-path) process-environment) - (setq tramp-remote-path (eshell-get-path))) + (setq tramp-remote-path (eshell-get-path t))) ;; MS-Windows needs special setting of encoding/decoding, because ;; (a) non-ASCII text in command-line arguments needs to be ;; encoded in the system's codepage; and (b) because many Windows --=-=-= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit -- Xiaoyue Chen VVVU: Workers, Unite! --=-=-=--