From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 12 05:11:27 2023 Received: (at submit) by debbugs.gnu.org; 12 Nov 2023 10:11:27 +0000 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 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 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 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== 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 Received: from racc (unknown) by geopod-ismtpd-4 (SG) with ESMTP id V062ytKdR8SAf4gkoOFNWg for ; Sun, 12 Nov 2023 08:52:00.048 +0000 (UTC) User-agent: mu4e 1.10.7; emacs 29.1.90 From: Xiaoyue Chen Subject: 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 X-SG-EID: =?us-ascii?Q?KIfOfgAJO7LiLJqGo05KETICuPS4rGc+DADhp2SRn=2F5=2FJ9TdeqdaZyduAWIGdV?= =?us-ascii?Q?R81sYxdmrE3rqeaP6kZP4fQHqptGz8zwiMnJ1ht?= =?us-ascii?Q?=2Fhrnkq4OWFkhuvpIq263CU5+8SVhSR7UA2FB2bx?= =?us-ascii?Q?dp+zCKO5ayIjQcBclnrUV7IyDR9cBqVTQwbkTLu?= =?us-ascii?Q?mzEOGR5BtoydbT5xg2CGmq=2F53nRmHJpxI6j1I9K?= =?us-ascii?Q?DuwCPZvJLDuBtD0uZhF4LzJjD6vUAl=2F2Ol7yY+?= To: bug-gnu-emacs@gnu.org X-Entity-ID: nX7yxtGGIkTtStmrUMuIyA== Content-Type: multipart/mixed; boundary="=-=-=" 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-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit 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 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.0 (/) --=-=-= 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! --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 12 15:19:07 2023 Received: (at 67126-done) by debbugs.gnu.org; 12 Nov 2023 20:19:07 +0000 Received: from localhost ([127.0.0.1]:57077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2GvD-00006Y-8o for submit@debbugs.gnu.org; Sun, 12 Nov 2023 15:19:07 -0500 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:51661) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2Gv7-00005z-LN for 67126-done@debbugs.gnu.org; Sun, 12 Nov 2023 15:19:06 -0500 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6bd0e1b1890so2766448b3a.3 for <67126-done@debbugs.gnu.org>; Sun, 12 Nov 2023 12:18:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699820294; x=1700425094; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=EhR8dI0W1VG5lx8LTt8I7N0HcHqzMPEHB3W0Z1MrgMM=; b=SydG5ZyEom9LD/RvGCBG9ux5OM7pTG1eSSYNeM/eaIwSEpsCGw40aueI6UrL58j5iY bGWI8HXgcwdVDMbTwDjbknuuYcIP9y+3nSDylsIL3RzlyuClhh5fKte7nwK9duQQ1pOx C3tTHVnRzKhGhdoaNfAOEPDlVS3k5HTpuoFBmKV05ZLhCTu34BkCTI+NFU9JpBUJwX2X qdfK/faeFyujmBrWgP7meHgZThBKQ54PUyTCYFpuRkU6qBrFdinCob1pTXPotm1e8icR EaMYY5Yces3vlBLAETbyGTUm6ssgKKNgI3tZAqH1qFbCQVH5TlVg+hY/3x64HPCu0pai 0saA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699820294; x=1700425094; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EhR8dI0W1VG5lx8LTt8I7N0HcHqzMPEHB3W0Z1MrgMM=; b=q5e4k/70tJ2nhaGewnBAszv5SoWGqgzet99SIp61Fxiu5FbW6zwlYvY03htNmuQ1wX IA9m/3IHNpjadtatBhGCeIY2amegwuIaG7AdPTDNCY9m7N+ik/v9ND0bW/46ZgHCVJnB 0KhQ01+bqH7sZWqfQGp4+yPngONxdY2V5uMy9beeK8IYFFcGiiyhus+eT47XsMIUot++ YdwYBl8FH+5p8U+AQoECpFvI9QUgUMjbkDy3xuPKwsxfP0GHHSPAUnV/uiP7pIaD7Rf+ yALt/oIEtCu5DwSd6oBgWu1ITuh2WeYVGy5gohlXQFhDbgbx34hhM7oqgMEDtTrgE/qd T5Rw== X-Gm-Message-State: AOJu0YzByoo5WLCxISamHgXYR/I9wR20CCs0Q9L9Kx6Of2yABYWYkHKD TBDA/T+FKse9jt4oyqPtu2I= X-Google-Smtp-Source: AGHT+IEBb+ntNMDw70zdcI+xHVMlsUVrFaBzDSAlewiDHe6auJIbawzwfSZWoolhBanCtvulL5T8bg== X-Received: by 2002:a05:6a00:1594:b0:6c5:d2bd:ad8b with SMTP id u20-20020a056a00159400b006c5d2bdad8bmr2618212pfk.31.1699820294548; Sun, 12 Nov 2023 12:18:14 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id n41-20020a056a000d6900b006bddd1ee5f0sm2799959pfv.5.2023.11.12.12.18.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Nov 2023 12:18:13 -0800 (PST) Message-ID: <640dd52c-69f6-15c6-a602-d6982f7bbf8a@gmail.com> Date: Sun, 12 Nov 2023 12:18:11 -0800 MIME-Version: 1.0 Subject: Re: bug#67126: eshell breaking tramp-remote-path Content-Language: en-US To: Xiaoyue Chen , 67126-done@debbugs.gnu.org References: <87y1f3s6a9.fsf@vvvu.org> From: Jim Porter In-Reply-To: <87y1f3s6a9.fsf@vvvu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 67126-done 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 (-) Version: 30.1 On 11/12/2023 12:52 AM, Xiaoyue Chen wrote: > 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. Thanks for the fix! I tried your patch and everything seems ok, plus it's obviously correct by inspection. Applied on the master branch as 52afc64bad7 and the emacs-29 branch as 5bebd292c63. (I accidentally merged to master first. Oh well.) Closing this now. From unknown Mon Aug 18 09:06:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 11 Dec 2023 12:24:06 +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