From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter 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: Sun, 27 Aug 2023 11:48:36 -0700 Message-ID: <3792bc23-2bad-8262-c674-26cec9d47b65@gmail.com> References: <861qfpnb9y.fsf@gmx.com> <87sf84s7bf.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4521"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65551@debbugs.gnu.org To: Michael Albinus , Jordan Wilson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 27 20:49:05 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 1qaKoq-0000ur-Hi for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Aug 2023 20:49:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qaKol-0001z8-Uf; Sun, 27 Aug 2023 14:49:00 -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 1qaKoj-0001yy-6y for bug-gnu-emacs@gnu.org; Sun, 27 Aug 2023 14:48:57 -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 1qaKoi-000826-UH for bug-gnu-emacs@gnu.org; Sun, 27 Aug 2023 14:48:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qaKoo-00039S-Eb for bug-gnu-emacs@gnu.org; Sun, 27 Aug 2023 14:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Aug 2023 18:49:02 +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.169316213612103 (code B ref 65551); Sun, 27 Aug 2023 18:49:02 +0000 Original-Received: (at 65551) by debbugs.gnu.org; 27 Aug 2023 18:48:56 +0000 Original-Received: from localhost ([127.0.0.1]:46268 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qaKoi-000399-91 for submit@debbugs.gnu.org; Sun, 27 Aug 2023 14:48:56 -0400 Original-Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]:53266) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qaKod-00038q-HU for 65551@debbugs.gnu.org; Sun, 27 Aug 2023 14:48:54 -0400 Original-Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-34bbc5eb310so8981505ab.2 for <65551@debbugs.gnu.org>; Sun, 27 Aug 2023 11:48:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693162120; x=1693766920; 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=kbbljR5dN+PX5Viv7jUcG2lhZXsI9dcsJ23hbsr1PWc=; b=jdNW0hKRs+M2tCMlhJzWW+grBLibkYJjUxO+aT0F8FOECu4STlxLDKmxT4c6HGUQS+ zNYrGM4Rsp9IFUkhSZ+X3VaN5LjOGAnXWVqNw6t/EMBsMNGIbqANj/5/Ku7tUHLOh9h0 m0AzvYkBsWba/ZtP/2Bq00R/c6q7Cd9ZFgJT1Z32z8T3MyxcxMOs8AzTQjwNvh1nFVOE MgvfXoZnwe6/Jn18OpwlyYzMbLh13KtnAZ9HsIhvI6UKC/q2UNDPfAKYGN89FJmhMmAO 8shl4d3dIknXBdgRIQ+PNlZuVhCmfQIb1yr2jtBlKMNRR3gdbhD07eqmrncyeDoLMWc2 p2mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693162120; x=1693766920; 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=kbbljR5dN+PX5Viv7jUcG2lhZXsI9dcsJ23hbsr1PWc=; b=XSfM6gzVmha9QT0hChvpR8LbARGZylvGqTGHYY7tzIjs/PLY23zneh6pG6Ot+PCEZc A72Cz+EI9q1bUPxJsbmkWxyu3pZvzLZ+SqpWrUb6Rffnf/f8dkZqBUAcN2835CHJA8hi InS3FSnXyDz0sGsIm1a7LHyknETTwSawnp5v0bCvbhCkY97Ns50/7oiIlYlRtc5hTPFf cepv/+5Mf7+a3tKheloMgs8SIuA4Kikz2TqimGyARnoJjWgEJ/QSAaa7nA57npGwU7Q+ D6YE7U7e/yZb2HbjZh3Ql2DOnejF7oLFJCzUBFzPyOH5tS5HW/tiWFAng8cpoQm7EaNA llUA== X-Gm-Message-State: AOJu0Yyej5io2PnM0vwfddKhvkvDoPkiAp9Gp/23k2dWcwmYZulE4YUP 9sowX7d8oALKXD7eBvXGqSE= X-Google-Smtp-Source: AGHT+IHyDHFRvt0WZjJOJ5IgTVofLQnzGjpFkFynzdZt9O6QnLt7g/86nEF5bvGcDBcWDaEYsBzxZg== X-Received: by 2002:a92:d950:0:b0:34b:aef9:60d4 with SMTP id l16-20020a92d950000000b0034baef960d4mr12648004ilq.27.1693162119722; Sun, 27 Aug 2023 11:48:39 -0700 (PDT) Original-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 j10-20020a170902690a00b001c0aa301703sm5586091plk.63.2023.08.27.11.48.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Aug 2023 11:48:39 -0700 (PDT) Content-Language: en-US In-Reply-To: <87sf84s7bf.fsf@gmx.de> 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:268585 Archived-At: On 8/27/2023 10:50 AM, Michael Albinus wrote: > First I try to understand the scenario Eshell is using. If Eshell has > changed to a remote directory, and a command like "./test.sh" is called, > I would expect a synchronous process. But this doesn't seem to be the case: > >> tramp-file-name-handler(make-process :name "test.sh" :buffer # :command ("/home/username/test.sh") :filter eshell-output-filter :sentinel eshell-sentinel :connection-type nil :stderr nil :file-handler t) >> eshell-gather-process-output("/plink:username@example.com:/home/username/test.s..." nil) >> eshell-external-command("./test.sh" nil) > > `make-process' is called, an asynchronous process. Is this intended? Has > this been changed since Emacs 28? Yeah, that's intended. A couple of things did change in Emacs 29, but Eshell has always used an asynchronous process here. The goal is for the process to be only partially synchronous: Eshell will wait until the process is done before proceeding (e.g. to emit the next prompt), but it also wants to be async so that you can do other things in Emacs while waiting for the process to complete. > 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. 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...