From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#65551: 29.1; Eshell on MS-Windows using plink: 'plink' is not recognized as an internal or external command... Date: Mon, 28 Aug 2023 12:27:59 +0200 Message-ID: <877cpf31hs.fsf@gmx.de> References: <861qfpnb9y.fsf@gmx.com> <87sf84s7bf.fsf@gmx.de> <3792bc23-2bad-8262-c674-26cec9d47b65@gmail.com> 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="36960"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Jordan Wilson , 65551@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 28 12:29:16 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 1qaZUi-0009NE-9v for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Aug 2023 12:29:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qaZUP-0000Ap-Se; Mon, 28 Aug 2023 06:28:57 -0400 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 1qaZUO-0000AZ-61 for bug-gnu-emacs@gnu.org; Mon, 28 Aug 2023 06:28:56 -0400 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 1qaZUN-0002IR-GP for bug-gnu-emacs@gnu.org; Mon, 28 Aug 2023 06:28:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qaZUT-00064A-OI for bug-gnu-emacs@gnu.org; Mon, 28 Aug 2023 06:29:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Aug 2023 10:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65551 X-GNU-PR-Package: emacs Original-Received: via spool by 65551-submit@debbugs.gnu.org id=B65551.169321849723266 (code B ref 65551); Mon, 28 Aug 2023 10:29:01 +0000 Original-Received: (at 65551) by debbugs.gnu.org; 28 Aug 2023 10:28:17 +0000 Original-Received: from localhost ([127.0.0.1]:47065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qaZTk-00063C-QV for submit@debbugs.gnu.org; Mon, 28 Aug 2023 06:28:17 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:38617) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qaZTh-00062u-SI for 65551@debbugs.gnu.org; Mon, 28 Aug 2023 06:28:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1693218480; x=1693823280; i=michael.albinus@gmx.de; bh=vsfQS2cKqio4d/V8H32PPeuyWQB6V23V6wCiM7PK194=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=CJ+A+UT8fNo/twqV6h+ICydZTNM7iUV8me/qUtJK6gpFHF4AD8QAbfdKn9aCU+d96GKVBr7 kdLOKqso0nFnv+D4r5uyiBu+0m7bE6Ov+8209Y/hPQgbXwOYsPRu3/iFDnL8g6iDY3G+cE1pv 7ZaCNsHyLZS7dmVizDKAg2XDHULQRZhwviMH/0HNwwIoyOVJP0/pFD+0QR/FsYEQSzQPiwcH8 O7Rsg14Gw6llf+oZd43rAxmUJ11MNJJdIx5OnChyKQmeI72SRX0VoBNV/gDoOp2bDN+l0pbQ5 MDIdBz3vPyGjOrXDhIHYNgTWWKCPWo1QaK20+FdZQY+bnpHCx+cQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.39.16]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MBDnI-1qOzPy2Umc-00CfwQ; Mon, 28 Aug 2023 12:28:00 +0200 In-Reply-To: <3792bc23-2bad-8262-c674-26cec9d47b65@gmail.com> (Jim Porter's message of "Sun, 27 Aug 2023 11:48:36 -0700") X-Provags-ID: V03:K1:rZj9fl63KjBWhB9OFbFORzeF+jDE6l5K0xkgrEdvuQm8hAz99pC VJ/LIMPyaCSiSL1nT8sxZDZlQh7045doBkmUGCid7nAHjDBf/F6xWjJE7Y8w+5Ga2+GTKNo TAfvaQKCfhoTX+NWlZQgOTEGiMTVHRv4/Lyl6gOO5FPuXYg+W2775vmAbqdxbwasWcnRVDx E1YztlhZM49L/wyeoCnFA== UI-OutboundReport: notjunk:1;M01:P0:pFv7mT1gEJk=;31fQU3+aErboGxIOdUdTfTw2qdD 8MPuj8UvBRxQ+x9DMYqMnr9lhK/Iwdxepqr5a4WEJ5QInaGIVJGI8PEyW3aP8D5mwLydrNDyQ /byp4xreZ7pOLVERrt4HvymC4RamnbHx1GPfSYv+CGm8NGgJlmad+8g8fE119LbpLkTBXx/Ei CjD15zxVVeOz00BwiLHks37BmEh0EjPtXFbYHMfjqWR8I+8r7tEfhpbqxNu97E7uhxB+5lsth pYYcdGm3cKuo9sbyXbfQ0J49mBQ/8bHHC+jxYJgqSZsMFuDOM6/1yHLL4weNHOuCRWEjL+sW4 MufGBnrHZ3EVh1vQdTlzbP6D3XGRRhfa2RXSVuukjaPssVIWoU20jYnN1D9FTYVJScjHHW/St IrH/0INXQSdmgOyruzRwLC+cTIQaRSIXarnwZsA9xPVuAiMlVdbtZHd6KFxypDPr/AlMkQSMY XXEv4JwjdJYMYt2U72INheoXmyTaBfarqbGtRPa0/RQEkBjqA/81zDVtkV96ImNuICFto3XDz R4K5XA2u4LBJ0bRxAqh0HXu2hhJGDLqFbqtbCFoC+FSZbx8WfEi3QZOWZ8g8Sp59WtGI3y++R AeT6wlNQ07vJO7OqQCcrCguyWELOmpjNiaoMnP7mPKMRRrVuFcjcgowpnEaqvVSbs4ISfrEg5 Qus4TELcTP+I46ZTFoxyNn8KQ8niYsTxfL18pXXP/qFyYB28rYhP9fYWPu0i1JkCGDFwnlAt3 wW8q3tM3R665zoYQSviK/jS/jjGBXXvj8Evw/645PiETrGBLbuUcnjiHPLdiJZ3CVHKRd0LU 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:268613 Archived-At: --=-=-= Content-Type: text/plain Jim Porter writes: Hi Jim, >> Second, I've played a little bit on MS Windows. I haven't installed >> Emacs 29 there, just an Emacs git master checkout. And plink is not in >> the PATH of my MINGW64 bash shell, so I'm using sshx. But everything >> works under this constellation: > > I'm using sshx locally to test this, and can reproduce the > issue. Maybe your MINGW64 configuration is smoothing over the bug for > you. When I tested this, I started from the MS-Windows "cmd.exe" and > ran "emacs -Q", with "ssh.exe" in my PATH. Yes, with this scenario I see the problem as well. > In Emacs 28, this worked fine, but it regressed in 29. I believe this > is due to commit cee1cbfd54375cdece23d4741ced6b0c7091f6d9, which > changes how Eshell manages its PATH env var. > > I think what Eshell would want here is to set its environment > variables *only* for the subprocess it creates via 'make-process'. For > local subprocesses, I don't think we need to do anything fancy, but > for the remote case, we'd need a way to say "use the original > process-environment for all the Tramp code, but use this new > process-environment for the actual subprocess". Maybe there's already > a way to do this, or maybe we need to add some new powers to > 'make-process' or something... AFAICS, the problem is in eshell-environment-variables, which sets PATH to the remote path. There are good reasons that Tramp doesn't handle the PATH environment variable, but uses its own tramp-remote-path variable. I've applied the following sledge-hammer patch, which cures the problem for me. But I'm pretty sure there are better ways in Eshell to fix this. Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 711c35f8527..4c5ce1a1a35 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -459,7 +459,7 @@ eshell-environment-variables environment, as specified in `eshell-variable-aliases-list'." (let ((process-environment (eshell-copy-environment))) (dolist (var-alias eshell-variable-aliases-list) - (if (nth 2 var-alias) + (if (and (not (string-equal (car var-alias) "PATH")) (nth 2 var-alias)) (setenv (car var-alias) (eshell-stringify (or (eshell-get-variable (car var-alias)) ""))))) --=-=-=--