From unknown Sat Jun 21 05:04:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#68618: 29.1; Tramp remote process fails in Eshell Resent-From: Sean Devlin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Jan 2024 18:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68618 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 68618@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17057754802607 (code B ref -1); Sat, 20 Jan 2024 18:32:01 +0000 Received: (at submit) by debbugs.gnu.org; 20 Jan 2024 18:31:20 +0000 Received: from localhost ([127.0.0.1]:35725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRG7j-0000fy-RV for submit@debbugs.gnu.org; Sat, 20 Jan 2024 13:31:20 -0500 Received: from lists.gnu.org ([2001:470:142::17]:56160) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRG7i-0000fl-52 for submit@debbugs.gnu.org; Sat, 20 Jan 2024 13:31:19 -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 1rRG7Y-0008Di-NC for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 13:31:09 -0500 Received: from mail-qv1-xf2b.google.com ([2607:f8b0:4864:20::f2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rRG7T-00088L-Gp for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 13:31:08 -0500 Received: by mail-qv1-xf2b.google.com with SMTP id 6a1803df08f44-681922a61baso15872486d6.1 for ; Sat, 20 Jan 2024 10:31:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20230601.gappssmtp.com; s=20230601; t=1705775461; x=1706380261; darn=gnu.org; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=NODhNtJxOOMEhmA5PaJ/5KveKzCRvTxM08G+lLu7Yq0=; b=l9PsszPbYpfzeqZsYD4IX7JQod2oCQVo1E2tyyEMyldHJ5RVT6iiusXqaSwIETWwzK ygRRbtzH+P3DPHWHM2TERSFsrwOVExc4RrqzOwpGXZZsEHbHKsKftvy6ydelOBzWEovz yad04wiUxTleWYtttXoOp2GitokRviaospjJGgJhWD++prPmVA57jq3wdLZFehgv+B4o VOU9qKPbM2ayPxgcA3ZGhnmC9JJG6yhHLeXKBjtBjOvbyzfxjlNut0MiP9KLy1r7QTH5 G8nMKDkR/+1m3lwT/jXdkIL/CGjtQfNdY/aJUZogrKV0jvNFLlUr4YgwxVvoeCpK8vnl cJJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705775461; x=1706380261; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NODhNtJxOOMEhmA5PaJ/5KveKzCRvTxM08G+lLu7Yq0=; b=Ox85Co86EqdvR3Ll7BGbNSg5Q32dMZMNZPt5X/X7OriDMAMSsWVZNGa8GxxewYNBTU ysOnj2EGUr+MNQfSvagPQkLSVSlGol/5Y741lUi8FgmHCSG8lsQ8iyXxgeE7sdCexmVe 5eCkQimJqH42DPSHFskt0CkjLTLjGwqQEtisp0fbCBl3zbIhEpKmk1uaMN0XF+tIBfL0 ruaJhjYcda0NQSzNPhHTGOcsscdpofHjJJJuRLCJ19f1yhjQfEyVszJilkpM4xTS5jRL 8Dprp0U3HCD+0St7+TLMtKaC5l6cw7wAlVwgnOk5zhdGlURyWZKZLFfruZMl+SppaotV fAuA== X-Gm-Message-State: AOJu0YwqPezNcfgOIMuDF2reQsHwGxwhNlmLX8oIYa0TFntizOV6emd9 WOStytfz6EpYmwq0HKvl+PG1DHo2dO5TQfB6HIpMrJm8i5AilvwM2kc6lHSThwpvh/TWM5QVrLD B X-Google-Smtp-Source: AGHT+IEsJ6oPo76EYMBAdUu+kCBcWH3Jlah9JanfvwiHAiRZlwLYwRZvHatZQWyV7965++9geMf1rw== X-Received: by 2002:a05:6214:260c:b0:681:95a2:472e with SMTP id gu12-20020a056214260c00b0068195a2472emr4078248qvb.18.1705775460920; Sat, 20 Jan 2024 10:31:00 -0800 (PST) Received: from smtpclient.apple ([70.107.172.48]) by smtp.gmail.com with ESMTPSA id lx11-20020a0562145f0b00b00683699c1a31sm813358qvb.26.2024.01.20.10.31.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Jan 2024 10:31:00 -0800 (PST) From: Sean Devlin Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.131\)) Message-Id: <8E295029-A618-4D34-8214-1B1134FB8118@toadstyle.org> Date: Sat, 20 Jan 2024 13:30:55 -0500 X-Mailer: Apple Mail (2.3774.500.131) Received-SPF: pass client-ip=2607:f8b0:4864:20::f2b; envelope-from=spd@toadstyle.org; helo=mail-qv1-xf2b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) 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 (/) Hi folks, I found a situation where a Tramp remote process invoked via Eshell fails unexpectedly. I discovered this while developing a custom Tramp method, but it could equally apply to built-in methods under certain system configurations. Here's a recipe to reproduce: 1. Create a symlink to the ssh program in an unusual location: $ mkdir -p /tmp/bin $ ln -s $(which ssh) /tmp/bin/myssh 2. Start Emacs with this directory in your path: $ PATH=/tmp/bin:$PATH emacs -Q 3. Evaluate these forms: (require 'tramp) (add-to-list 'tramp-methods `("myssh" (tramp-login-program "myssh") ,@(cdr (assoc "ssh" tramp-methods)))) 4. M-x eshell 5. In Eshell: $ cd /myssh:someremote: $ uname -a 6. The Eshell buffer will show some corrupt output something like: sh: cd: /root/: No such file or directory ///61166bb64799e9d0ec9f78bc44cc9d3d#$ I did a little debugging, and I found that the "uname -a" process is created under a let-binding of process-environment established in eshell-gather-process-output. This binding changes the PATH environment variable. I think maybe it's setting it to the remote path from the Tramp session, since our local directory in Eshell is /myssh:someremote:. This is a problem for Tramp, since it needs to start up a new "/bin/sh -i" process to create the connection to run "uname -a" on the remote host. When it starts the local shell process, it is now using the wrong executable path, and it cannot find myssh, since it is in a non-standard location. You can see this by tracing process-send-string and internal-default-process-filter before running "uname -a" in Eshell. When Tramp tries to send "myssh ..." to the /bin/sh process, it will get back an error saying myssh cannot be found. I think Tramp and/or Eshell need to make sure this /bin/sh subprocess is started with the local executable path and not the path from the remote host. There is a simple workaround: update your Tramp method's login program to use an absolute filename, e.g. /tmp/bin/myssh. Thanks! In GNU Emacs 29.1 Windowing system distributor 'Apple' System Description: macOS 14 Configured using: 'configure --with-ns '--enable-locallisppath=/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules 'CFLAGS=-DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT' --with-x-toolkit=no' Configured features: ACL GLIB GMP GNUTLS JPEG JSON LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Eshell Minor modes in effect: eshell-prompt-mode: t eshell-hist-mode: t eshell-pred-mode: t eshell-cmpl-mode: t eshell-proc-mode: t eshell-arg-mode: t shell-dirtrack-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils em-unix em-term term disp-table ehelp em-script em-prompt em-ls em-hist em-pred em-glob em-extpipe em-cmpl em-dirs esh-var em-basic em-banner em-alias esh-mode eshell esh-cmd generator esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util dired-aux dired dired-loaddefs cl-extra pp cl-print tramp-adb tramp-archive tramp-cache time-stamp tramp-cmds tramp-container tramp-ftp tramp-gvfs url-util url-parse url-vars dbus xml tramp-sh thingatpt help-fns radix-tree help-mode tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat rx parse-time iso8601 time-date format-spec auth-source cl-seq eieio eieio-core cl-macs cl-loaddefs cl-lib password-cache json map byte-opt gv bytecomp byte-compile shell subr-x pcomplete comint ansi-osc ansi-color ring rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 99526 10654) (symbols 48 10616 0) (strings 32 37029 1504) (string-bytes 1 1188080) (vectors 16 22340) (vector-slots 8 297950 17878) (floats 8 64 26) (intervals 56 1230 0) (buffers 984 16)) From unknown Sat Jun 21 05:04:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#68618: 29.1; Tramp remote process fails in Eshell Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Jan 2024 19:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68618 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Sean Devlin , 68618@debbugs.gnu.org Received: via spool by 68618-submit@debbugs.gnu.org id=B68618.170577726316434 (code B ref 68618); Sat, 20 Jan 2024 19:02:02 +0000 Received: (at 68618) by debbugs.gnu.org; 20 Jan 2024 19:01:03 +0000 Received: from localhost ([127.0.0.1]:35780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRGaV-0004Gz-8l for submit@debbugs.gnu.org; Sat, 20 Jan 2024 14:01:03 -0500 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]:44418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRGaP-0004GH-3S for 68618@debbugs.gnu.org; Sat, 20 Jan 2024 14:01:01 -0500 Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3bbbc6bcc78so1739174b6e.1 for <68618@debbugs.gnu.org>; Sat, 20 Jan 2024 11:00:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705777248; x=1706382048; 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=D1YSTOzU0cxHTdk6AlxL2+WNjHqP7d1W5GLw4Nf4gLs=; b=gEodZZTufhX7r4r+DqATWU8VY2tQpNh/S+Y+jrCdnIxb8LTkbJgSp2H89s8+ybqZkL erKKHEWA6FhnHD28+5nvzxsx8i9H0ih1N4VNox8rBIDB+rwjyCmK23LUKRxkxs4l3iVK rPoFSg3zb1DD8SQLKah6CbaZL/jscHtGWgOBcV8ICCpuxbYJp+KO5TPVj3emc5B77aA6 YNH8+6m3DGs3eBUeBp6mYWVhQ8r3sUj7dOnwU3M8S4Sz8uEhXnK5cjh4zbhlJZKgFZD3 1WiWGDw4TGv19R6icQEjwuSCARrHwWwQnyC8YEIW8A3jQyCWkqxDQQKd3I42wZSSssSP E0BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705777248; x=1706382048; 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=D1YSTOzU0cxHTdk6AlxL2+WNjHqP7d1W5GLw4Nf4gLs=; b=JsXwBfQQeKN8zgaNPYNSEpzApKkYQMbgng0K78vRmIDljPrlgLQwEiKF7OSUVTOUwi bkXUZwILNQslCYK3wM4NcsLS6MmpxIgylnRdA3pSn/xFXviVDj5mSV5TLW3BDz+8XIEO OARR/cXLx2AoApNK8ItpJGaubfFPO1NFTXGVDxmM7i6jAEC3ZCEMt7uRHMPCLUulE86S uM1zfHwx8n21UagL1ZZbLIPmN0OxrOV1w6VcTTFAnpn7YdY4iPMbCS3mfSHcYtcLNzXm EY66OzLtSrRJKiuPmUWRruh4tvc2QNG4lxYxoexx+dN1yjVe+kqbU5z6F9HGjlGBEQVs cSnw== X-Gm-Message-State: AOJu0YxnufYUxgk1nsUGp1SmEiV29nmybM1z/ex0BMS9G08dKurIgnSw s2PLERjDhcVekjt0Z2vmyPCqXvq/mqH68PSZyOF9DkIUh7JeTTuJDu+qykET X-Google-Smtp-Source: AGHT+IEA6H1hE1bTLI0gWSq8AWVz21J0qUyDYQwL+wcTH9f/XSYrLLVMr1KljP4BaNqHAoy5EsQ9hA== X-Received: by 2002:a05:6808:1384:b0:3bd:b34a:6aa with SMTP id c4-20020a056808138400b003bdb34a06aamr429329oiw.71.1705777248250; Sat, 20 Jan 2024 11:00:48 -0800 (PST) Received: from [192.168.1.2] (076-168-148-233.res.spectrum.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id pl15-20020a17090b268f00b0028da4665bfbsm6334937pjb.8.2024.01.20.11.00.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 20 Jan 2024 11:00:47 -0800 (PST) Message-ID: Date: Sat, 20 Jan 2024 11:00:46 -0800 MIME-Version: 1.0 Content-Language: en-US References: <8E295029-A618-4D34-8214-1B1134FB8118@toadstyle.org> From: Jim Porter In-Reply-To: <8E295029-A618-4D34-8214-1B1134FB8118@toadstyle.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) 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 (-) On 1/20/2024 10:30 AM, Sean Devlin wrote: > I think Tramp and/or Eshell need to make sure this /bin/sh subprocess is > started with the local executable path and not the path from the remote > host. I believe this is the same issue as bug#65551, which is fixed in 29.2. Could you upgrade and try it out? From unknown Sat Jun 21 05:04:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#68618: 29.1; Tramp remote process fails in Eshell Resent-From: Sean Devlin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Jan 2024 19:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68618 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Porter Cc: 68618@debbugs.gnu.org Received: via spool by 68618-submit@debbugs.gnu.org id=B68618.170577952330552 (code B ref 68618); Sat, 20 Jan 2024 19:39:01 +0000 Received: (at 68618) by debbugs.gnu.org; 20 Jan 2024 19:38:43 +0000 Received: from localhost ([127.0.0.1]:35816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRHAw-0007we-Dm for submit@debbugs.gnu.org; Sat, 20 Jan 2024 14:38:43 -0500 Received: from mail-qv1-xf2b.google.com ([2607:f8b0:4864:20::f2b]:50450) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRHAs-0007wN-Ez for 68618@debbugs.gnu.org; Sat, 20 Jan 2024 14:38:41 -0500 Received: by mail-qv1-xf2b.google.com with SMTP id 6a1803df08f44-681397137afso16031216d6.1 for <68618@debbugs.gnu.org>; Sat, 20 Jan 2024 11:38:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20230601.gappssmtp.com; s=20230601; t=1705779510; x=1706384310; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qb9mEZ0ynAcbJQqi5UKP8g9u4Kb0HR7aScFNxt0eUKA=; b=EGCqI3bn9dMu/ZWySRtNxz6M6h7iIRrcfA5lBTa1igztbBLEyp2WXiFZkGy2cmNxXJ GfTTwJ/eOz1pnRrx2sZ1a9kxdvjDU7eusAecK+TXQYOh3JGrwoKVSd+e2OQ3B2t+KAw1 AUz1XtHu2wEV8FA1MIseoVPYI6BnNiaZ1N0gr5gskKr2Yyw6dkxeqmBz98acTy5lzQ5o XpE8HcSqmPVJX+iyyx68qxLd1QfTPghlzM6ATRv7+DP65HCScPmqGalpRDW3aMrcjcXu YgyXKgXOEIRJ4U/nZ2q+Go4mfcJ83N3am5gni1rSGmP6Rxv2l+IiBZB98Zf3R15f6p7B QkTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705779510; x=1706384310; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qb9mEZ0ynAcbJQqi5UKP8g9u4Kb0HR7aScFNxt0eUKA=; b=NWQbfx7NEj/TFQ5zStORlztbuBp9iyLa/LlzlzNaSyc8muTRMzRa3lcd65umxy++c7 6tfTMnuG/p7KHEy7kbZKwa2acdS+w80fAQSV5+ZTCTeuVZ/xO7N1muSeYov38j5brxCF UEGbQRAJJlRMY9h+BMaTUYQ+crFrr+WPsSZC2PJX5Guz+MwDBKwiUD+HT2WGJdsR+zZo I5VwwqLbgVuxrGcFr2OjpzWZg/L9qVpqpSpdPiKNeyDoQBClWg9ooJuh/GCoQJz9lony 6eG0EXVYUk7ZGj5391Ng8afrE6lo1L5dZnaecaNWKa4NsdOC4vnWeX39A2zFr4Jd7H+m j69Q== X-Gm-Message-State: AOJu0YyvYNGXu5WQ+yQgQtOSgF8GgzTdT1g64FKgKn5zieN/WhbYnIYJ NDhnioCaXL+vSFZwBwkpALhux7uKEC8qoX1vb16/oSGIDx8lmBdygbA7EQ61dPc= X-Google-Smtp-Source: AGHT+IHxNdPFazq5s7XBuJ4CTPH3HVgGYC1ECyCEQ6RYqXPG5v3P9DsUM7W/RUkhPK2PxlBAK4Je/g== X-Received: by 2002:ad4:5b89:0:b0:684:d760:cf7e with SMTP id 9-20020ad45b89000000b00684d760cf7emr2937510qvp.26.1705779509785; Sat, 20 Jan 2024 11:38:29 -0800 (PST) Received: from smtpclient.apple ([70.107.172.48]) by smtp.gmail.com with ESMTPSA id qj10-20020a056214320a00b00685f49e7a65sm465452qvb.32.2024.01.20.11.38.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Jan 2024 11:38:29 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.131\)) From: Sean Devlin In-Reply-To: Date: Sat, 20 Jan 2024 14:38:18 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <0BA2B1B9-9F20-459D-9153-76BF6E2516C9@toadstyle.org> References: <8E295029-A618-4D34-8214-1B1134FB8118@toadstyle.org> X-Mailer: Apple Mail (2.3774.500.131) X-Spam-Score: -0.0 (/) 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 (-) > On Jan 20, 2024, at 2:00=E2=80=AFPM, Jim Porter = wrote: >=20 > On 1/20/2024 10:30 AM, Sean Devlin wrote: >> I think Tramp and/or Eshell need to make sure this /bin/sh subprocess = is >> started with the local executable path and not the path from the = remote >> host. >=20 > I believe this is the same issue as bug#65551, which is fixed in 29.2. = Could you upgrade and try it out? Thanks, I didn=E2=80=99t realize 29.2 was out. It looks like you=E2=80=99re correct: the bug is resolved in 29.2. Thanks!= From unknown Sat Jun 21 05:04:00 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Sean Devlin Subject: bug#68618: closed (Re: bug#68618: 29.1; Tramp remote process fails in Eshell) Message-ID: References: <1c83d359-197e-5e80-0106-edc3028786a2@gmail.com> <8E295029-A618-4D34-8214-1B1134FB8118@toadstyle.org> X-Gnu-PR-Message: they-closed 68618 X-Gnu-PR-Package: emacs Reply-To: 68618@debbugs.gnu.org Date: Sat, 20 Jan 2024 20:10:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1705781402-12247-1" This is a multi-part message in MIME format... ------------=_1705781402-12247-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #68618: 29.1; Tramp remote process fails in Eshell which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 68618@debbugs.gnu.org. --=20 68618: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D68618 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1705781402-12247-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 68618-done) by debbugs.gnu.org; 20 Jan 2024 20:09:40 +0000 Received: from localhost ([127.0.0.1]:35853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRHeu-0003Ai-0t for submit@debbugs.gnu.org; Sat, 20 Jan 2024 15:09:40 -0500 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:55479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRHen-0003AM-Ki for 68618-done@debbugs.gnu.org; Sat, 20 Jan 2024 15:09:38 -0500 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-5ce9555d42eso1563833a12.2 for <68618-done@debbugs.gnu.org>; Sat, 20 Jan 2024 12:09:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705781364; x=1706386164; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=yJ0rJFBW+EqQ/1K60WcmT+nT5EZydFtC4EQs1l32vhc=; b=VnOIB1ygliFQmodxiBl9XjWVNZrFxjP8nIP18KBQPxrOG8yhFpCbd9CDkgFCouzlrb eTc890UQ56dUK7tENF3VWSV+YgNtNIXFrgT7TzAQp592yPM3T/7f4v6j4UcW4RmLqWIK hlqMNpTx95Jv6OZXTmGPBRLR9dJhwoB6h/fVMcdK6396ptv2npeG9tN1KkBEPfQ9uNjC QjBUKlcExGoAHwfgQjZFhcAugfPDJwQdvNZS4ImPHzmgLTcnAKr2qmmo8lZRaHbfKANi cPbQLkL90ufQFCXqWqpW/XNNzPAZfPKKI2xlBo+GoZEfkz8E4W4raIL+Msbhma3C97D/ Ax/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705781364; x=1706386164; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yJ0rJFBW+EqQ/1K60WcmT+nT5EZydFtC4EQs1l32vhc=; b=TTnon0EXdv3k2tb6ffngnnVMwfoVXGqKF6Wc7jLwCnF/MkOySLdZs4yTtjIFKWmkPe XP3XglTao4uvOIGP3S4t/MCTSa/oj8EGeqRYHI/I4sVIoztTAuIBiwVTh6V+Jz1kNGCV MhTwn02SXZS8QC0Po90RjVQZZ54+douPmOdKRi7X94Gma3/D2bWCNWZBTyCCAvpJBmja JJBH3DBUnYd7MChDhnCMHhg9HZ6zAm8bTUHq6gOXoWMZ0TKjEkxBMdwW6xLVVf6LdXu/ SqOKyiM7dAacV7xQnL9j7ixIPAp3yVUqMVWaCbt6Q0TjWTCUGb3K/3QQ2JuAefAneMhM MRmQ== X-Gm-Message-State: AOJu0YzbedtlJuAHstRYxwyUh7PKUEZ+VTWaVbnTjdMtpmkbIbjZLeGS w6wSGRx69GA4+v3rpYVLpCogL2lU5KidOK8RhIFNy+BsDKbi4nQ5mVNMPpAp X-Google-Smtp-Source: AGHT+IHVp5/f+KUAzIz868CG/km3oLa8+6iu6gUwhyprINgvxR9PRsQrxBKKFCwp2/VSeXWS+WMX0w== X-Received: by 2002:a05:6a20:3d08:b0:19a:f6f1:c63d with SMTP id y8-20020a056a203d0800b0019af6f1c63dmr2791406pzi.11.1705781364420; Sat, 20 Jan 2024 12:09:24 -0800 (PST) Received: from [192.168.1.2] (076-168-148-233.res.spectrum.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id v12-20020a63150c000000b005cdf9c8e922sm5573054pgl.85.2024.01.20.12.09.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 20 Jan 2024 12:09:23 -0800 (PST) Message-ID: <1c83d359-197e-5e80-0106-edc3028786a2@gmail.com> Date: Sat, 20 Jan 2024 12:09:22 -0800 MIME-Version: 1.0 Subject: Re: bug#68618: 29.1; Tramp remote process fails in Eshell Content-Language: en-US To: Sean Devlin References: <8E295029-A618-4D34-8214-1B1134FB8118@toadstyle.org> <0BA2B1B9-9F20-459D-9153-76BF6E2516C9@toadstyle.org> From: Jim Porter In-Reply-To: <0BA2B1B9-9F20-459D-9153-76BF6E2516C9@toadstyle.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 68618-done Cc: 68618-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.0 (-) On 1/20/2024 11:38 AM, Sean Devlin wrote: > Thanks, I didn’t realize 29.2 was out. > > It looks like you’re correct: the bug is resolved in 29.2. Thanks for checking. Closing this bug now. ------------=_1705781402-12247-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 20 Jan 2024 18:31:20 +0000 Received: from localhost ([127.0.0.1]:35725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRG7j-0000fy-RV for submit@debbugs.gnu.org; Sat, 20 Jan 2024 13:31:20 -0500 Received: from lists.gnu.org ([2001:470:142::17]:56160) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRG7i-0000fl-52 for submit@debbugs.gnu.org; Sat, 20 Jan 2024 13:31:19 -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 1rRG7Y-0008Di-NC for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 13:31:09 -0500 Received: from mail-qv1-xf2b.google.com ([2607:f8b0:4864:20::f2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rRG7T-00088L-Gp for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 13:31:08 -0500 Received: by mail-qv1-xf2b.google.com with SMTP id 6a1803df08f44-681922a61baso15872486d6.1 for ; Sat, 20 Jan 2024 10:31:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20230601.gappssmtp.com; s=20230601; t=1705775461; x=1706380261; darn=gnu.org; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=NODhNtJxOOMEhmA5PaJ/5KveKzCRvTxM08G+lLu7Yq0=; b=l9PsszPbYpfzeqZsYD4IX7JQod2oCQVo1E2tyyEMyldHJ5RVT6iiusXqaSwIETWwzK ygRRbtzH+P3DPHWHM2TERSFsrwOVExc4RrqzOwpGXZZsEHbHKsKftvy6ydelOBzWEovz yad04wiUxTleWYtttXoOp2GitokRviaospjJGgJhWD++prPmVA57jq3wdLZFehgv+B4o VOU9qKPbM2ayPxgcA3ZGhnmC9JJG6yhHLeXKBjtBjOvbyzfxjlNut0MiP9KLy1r7QTH5 G8nMKDkR/+1m3lwT/jXdkIL/CGjtQfNdY/aJUZogrKV0jvNFLlUr4YgwxVvoeCpK8vnl cJJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705775461; x=1706380261; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NODhNtJxOOMEhmA5PaJ/5KveKzCRvTxM08G+lLu7Yq0=; b=Ox85Co86EqdvR3Ll7BGbNSg5Q32dMZMNZPt5X/X7OriDMAMSsWVZNGa8GxxewYNBTU ysOnj2EGUr+MNQfSvagPQkLSVSlGol/5Y741lUi8FgmHCSG8lsQ8iyXxgeE7sdCexmVe 5eCkQimJqH42DPSHFskt0CkjLTLjGwqQEtisp0fbCBl3zbIhEpKmk1uaMN0XF+tIBfL0 ruaJhjYcda0NQSzNPhHTGOcsscdpofHjJJJuRLCJ19f1yhjQfEyVszJilkpM4xTS5jRL 8Dprp0U3HCD+0St7+TLMtKaC5l6cw7wAlVwgnOk5zhdGlURyWZKZLFfruZMl+SppaotV fAuA== X-Gm-Message-State: AOJu0YwqPezNcfgOIMuDF2reQsHwGxwhNlmLX8oIYa0TFntizOV6emd9 WOStytfz6EpYmwq0HKvl+PG1DHo2dO5TQfB6HIpMrJm8i5AilvwM2kc6lHSThwpvh/TWM5QVrLD B X-Google-Smtp-Source: AGHT+IEsJ6oPo76EYMBAdUu+kCBcWH3Jlah9JanfvwiHAiRZlwLYwRZvHatZQWyV7965++9geMf1rw== X-Received: by 2002:a05:6214:260c:b0:681:95a2:472e with SMTP id gu12-20020a056214260c00b0068195a2472emr4078248qvb.18.1705775460920; Sat, 20 Jan 2024 10:31:00 -0800 (PST) Received: from smtpclient.apple ([70.107.172.48]) by smtp.gmail.com with ESMTPSA id lx11-20020a0562145f0b00b00683699c1a31sm813358qvb.26.2024.01.20.10.31.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Jan 2024 10:31:00 -0800 (PST) From: Sean Devlin Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.131\)) Subject: 29.1; Tramp remote process fails in Eshell Message-Id: <8E295029-A618-4D34-8214-1B1134FB8118@toadstyle.org> Date: Sat, 20 Jan 2024 13:30:55 -0500 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3774.500.131) Received-SPF: pass client-ip=2607:f8b0:4864:20::f2b; envelope-from=spd@toadstyle.org; helo=mail-qv1-xf2b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) 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.0 (/) Hi folks, I found a situation where a Tramp remote process invoked via Eshell fails unexpectedly. I discovered this while developing a custom Tramp method, but it could equally apply to built-in methods under certain system configurations. Here's a recipe to reproduce: 1. Create a symlink to the ssh program in an unusual location: $ mkdir -p /tmp/bin $ ln -s $(which ssh) /tmp/bin/myssh 2. Start Emacs with this directory in your path: $ PATH=/tmp/bin:$PATH emacs -Q 3. Evaluate these forms: (require 'tramp) (add-to-list 'tramp-methods `("myssh" (tramp-login-program "myssh") ,@(cdr (assoc "ssh" tramp-methods)))) 4. M-x eshell 5. In Eshell: $ cd /myssh:someremote: $ uname -a 6. The Eshell buffer will show some corrupt output something like: sh: cd: /root/: No such file or directory ///61166bb64799e9d0ec9f78bc44cc9d3d#$ I did a little debugging, and I found that the "uname -a" process is created under a let-binding of process-environment established in eshell-gather-process-output. This binding changes the PATH environment variable. I think maybe it's setting it to the remote path from the Tramp session, since our local directory in Eshell is /myssh:someremote:. This is a problem for Tramp, since it needs to start up a new "/bin/sh -i" process to create the connection to run "uname -a" on the remote host. When it starts the local shell process, it is now using the wrong executable path, and it cannot find myssh, since it is in a non-standard location. You can see this by tracing process-send-string and internal-default-process-filter before running "uname -a" in Eshell. When Tramp tries to send "myssh ..." to the /bin/sh process, it will get back an error saying myssh cannot be found. I think Tramp and/or Eshell need to make sure this /bin/sh subprocess is started with the local executable path and not the path from the remote host. There is a simple workaround: update your Tramp method's login program to use an absolute filename, e.g. /tmp/bin/myssh. Thanks! In GNU Emacs 29.1 Windowing system distributor 'Apple' System Description: macOS 14 Configured using: 'configure --with-ns '--enable-locallisppath=/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules 'CFLAGS=-DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT' --with-x-toolkit=no' Configured features: ACL GLIB GMP GNUTLS JPEG JSON LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Eshell Minor modes in effect: eshell-prompt-mode: t eshell-hist-mode: t eshell-pred-mode: t eshell-cmpl-mode: t eshell-proc-mode: t eshell-arg-mode: t shell-dirtrack-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils em-unix em-term term disp-table ehelp em-script em-prompt em-ls em-hist em-pred em-glob em-extpipe em-cmpl em-dirs esh-var em-basic em-banner em-alias esh-mode eshell esh-cmd generator esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util dired-aux dired dired-loaddefs cl-extra pp cl-print tramp-adb tramp-archive tramp-cache time-stamp tramp-cmds tramp-container tramp-ftp tramp-gvfs url-util url-parse url-vars dbus xml tramp-sh thingatpt help-fns radix-tree help-mode tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat rx parse-time iso8601 time-date format-spec auth-source cl-seq eieio eieio-core cl-macs cl-loaddefs cl-lib password-cache json map byte-opt gv bytecomp byte-compile shell subr-x pcomplete comint ansi-osc ansi-color ring rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 99526 10654) (symbols 48 10616 0) (strings 32 37029 1504) (string-bytes 1 1188080) (vectors 16 22340) (vector-slots 8 297950 17878) (floats 8 64 26) (intervals 56 1230 0) (buffers 984 16)) ------------=_1705781402-12247-1--