From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#33791: 26.1; Eshell on Windows connecting to GNU/Linux machine using TRAMP and plink: env: =?UTF-8?Q?=E2=80=98c:/home/jordan/test.sh=E2=80=99:?= No such file or directory Date: Sat, 29 Dec 2018 12:12:56 +0100 Message-ID: <87d0pkr3gn.fsf@gmx.de> References: <87pntyanho.fsf@gmx.com> <83zhsxap9i.fsf@gnu.org> <875zvluaby.fsf@gmx.de> <83r2e9alte.fsf@gnu.org> <87woo0s9g1.fsf@gmx.com> <83woo08cb7.fsf@gnu.org> <874lazqekr.fsf@gmx.de> <8336qi6p9r.fsf@gnu.org> <87sgyhtvjc.fsf@gmx.com> <83sgyh5vxv.fsf@gnu.org> <87bm55tpvc.fsf@gmx.com> <83ftug66lf.fsf@gnu.org> <87sgygr8fi.fsf@gmx.de> <83a7ko64au.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1546082204 23196 195.159.176.226 (29 Dec 2018 11:16:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 29 Dec 2018 11:16:44 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: jordan.t.wilson@gmx.com, 33791@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 29 12:16:39 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gdCbe-0005v3-Fa for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Dec 2018 12:16:39 +0100 Original-Received: from localhost ([127.0.0.1]:35886 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdCdl-0007c3-6W for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Dec 2018 06:18:49 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:52648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdCdR-0007T7-UN for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2018 06:18:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gdCZ8-0003Pt-W0 for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2018 06:14:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43936) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gdCZ8-0003Pe-PR for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2018 06:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gdCZ8-0001x8-BQ for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2018 06:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Dec 2018 11:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33791 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33791-submit@debbugs.gnu.org id=B33791.15460819897427 (code B ref 33791); Sat, 29 Dec 2018 11:14:02 +0000 Original-Received: (at 33791) by debbugs.gnu.org; 29 Dec 2018 11:13:09 +0000 Original-Received: from localhost ([127.0.0.1]:40871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gdCYG-0001vj-I0 for submit@debbugs.gnu.org; Sat, 29 Dec 2018 06:13:08 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:41789) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gdCYD-0001vB-Er for 33791@debbugs.gnu.org; Sat, 29 Dec 2018 06:13:06 -0500 Original-Received: from detlef.gmx.de ([213.220.156.5]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LjZhg-1hEkDp3cng-00baaD; Sat, 29 Dec 2018 12:12:58 +0100 In-Reply-To: <83a7ko64au.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 29 Dec 2018 12:00:25 +0200") X-Provags-ID: V03:K1:ToH2la8Ne86aH9/uYiJvz3KUW3cnTPLGCu+61VqsQ5PTQbBHXz5 GLwm980/iKSdsvLi+2UsShDTcX1ELhk/Rxpzz18dfjWDi7y7fV9wwE8ehnjM+N/zhCG0/84 HRRpP2NSJNGpnxo5lq9df96MbIEtewsH6co6fUyxxODlG6JK6QsuIkOCxrdvaEpTDFQIyyY F2Oxz6y7ICbNIrtqH529w== X-UI-Out-Filterresults: notjunk:1;V03:K0:0/xYCHW7II8=:vWtmx9fYBSusv3neUIzhEz VUjy2/SMQoHiluCHr+Kti8pfbctRpQ6rJz8tssJcCDBqW2bKYxuIPizzpEGPpZIfRJ/mFTk9n bv5PGk5ujHM1aW8elsDSvorkX0epP4k09L0a6cYY65qL61Bcy2JYFz91xp09gyEkYvxyV+hE/ x2Io/Vyl4xD6IQR8J+dTfHqa+UIJ320r/J84PY78DFEhCHTGEHmKmK9zXJHpsO9y0qLB3bfXk RppOk1JaiD3oCX2Wkgg8/SmmYpP21wbGjOFp+S+PgJBMo58TqVlY1a+odiZFTabU+HStJG0oF GNXwi4ojh0KzatW8fbTpR+9HWhNDqy/0e2soiCedcuFo7d0tENIykQHcX7istuidnLsz2N1Wt G9+XXdrh2bYw0rBlOtfrWzPexP1HcyWC4Y5qAkSllqHhzJth4sNHWYWSGbsjzP8JT7sS4aq2p EjPulojTzTKMDYRBuVmWwSy4ArzaauV9LgFtWuw7jiGx5+8b3oPqwPBD6ukj2i8IIQEg5JG9F gNYS7DON0B2N0biz/NjkgJMLQW2qUHh5JEHPvBfX+7VMt9eGcyYocfaA1i9EYOvp52gd/1Sw5 v2kqrQYveqSOMXaGkZgVYsQbtzSN5LqL70Y+6G5QVI98LQZN9k8rjbrAzbcsXl51gX8+v64zt RAfa4O1/MTnkWZuDVLpZDVYhBsLZejE5SNfdKxH0SH2S7o6opoZauakVSHJdwhw7Uj9ZQs+Bp GCKMseiveBhXyOaYtlwEDJHJZ6yKEBNvNZG+g3/WC4YspB9JIeBgMrn1/FvNey9e8hfQl/jj X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:153988 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: Hi Eli & Jordan, >> As you see, it requires two changes, in esh-proc.el and tramp.el. > > I think both can be cherry-picked to emacs-26. Done. The change in tramp.el needed some massage. Jordan, could you pls test whether the changes I have applied to the emacs-26 branch work for you? See attachment for the changes. > But do you know why we need expand-file-name here at all? Well, in Emacs 26 we couldn't adapt exec-path for remote processes. This is available since Emacs 27 only. > At the very least, the comment about start-process should be removed, > I think. Done. >> > Btw, isn't it confusing that start-file-process needs only the "local" >> > part of COMMAND? Why cannot its handler DTRT internally instead? >>=20 >> What do you do, if COMMAND is another remote location than >> default-directory? > > Why is that a problem? We always run the process in > default-directory, right? I said "another *remote* location". I don't want to see (let ((default-directory "/ssh:user@host:directory")) (start-file-process "foo" buffer "/ssh:another-user@another-host:foo")) Of course one could raise an error. But usually, this construct doesn't appear as direct as in the example. I believe using a local name for PROGRAM isn't such a burden. >> And more general, there could also be file names in the PROGRAM-ARGS >> part of start-file-process. Who decides, which of them is a remote file >> name to be stripped to the local part, and which offers remote file name >> syntax to be used literally? > > the caller, of course. But I'm not asking about arguments, I'm asking > about PROGRAM, and only about it. See above. I don't believe it would make the life easier for callers of `start-file-process', if we would allow a remote file name for PROGRAM.=20 >> That's why we have decided (long ago), to not allow remote arguments for >> both start-file-process and process-file. > > At the very least, this should be prominently mentioned in the > respective doc strings and in the ELisp manual. As written now, this > is entirely undocumented. Moreover, the part about "the local part of > default-directory" in the doc string and in the manual is confusing, > because we have no description of what that means. The only attempt > of describing it, in file-local-name's doc string, viz.: > > It returns a file name which can be used directly as argument of > =E2=80=98process-file=E2=80=99, =E2=80=98start-file-process=E2=80=99, o= r =E2=80=98shell-command=E2=80=99. > > is IMO unsatisfactory, because it describes how results could be used, > not what they are. The docstring speaks about. --8<---------------cut here---------------start------------->8--- PROGRAM and PROGRAM-ARGS might be file names. They are not objects of file name handler invocation. --8<---------------cut here---------------end--------------->8--- The Elisp manual speaks about. (info "(elisp) Asynchronous Processes") --8<---------------cut here---------------start------------->8--- This function does not try to invoke file name handlers for PROGRAM or for the rest of ARGS. --8<---------------cut here---------------end--------------->8--- Best regards, Michael. --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el index 94401c5daa..97170eb04b 100644 --- a/lisp/eshell/esh-proc.el +++ b/lisp/eshell/esh-proc.el @@ -279,11 +279,9 @@ eshell-gather-process-output (let ((process-connection-type (unless (eshell-needs-pipe-p command) process-connection-type)) - (command (file-local-name command))) + (command (file-local-name (expand-file-name command)))) (apply 'start-file-process - (file-name-nondirectory command) nil - ;; `start-process' can't deal with relative filenames. - (append (list (expand-file-name command)) args)))) + (file-name-nondirectory command) nil command args))) (eshell-record-process-object proc) (set-process-buffer proc (current-buffer)) (if (eshell-interactive-output-p) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 5fa9f9a44d..5302659b32 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4580,10 +4580,11 @@ tramp-eshell-directory-change (or ;; When `tramp-own-remote-path' is in `tramp-remote-path', ;; the remote path is only set in the session cache. + ;; Use `path-separator' as it does eshell. (tramp-get-connection-property (tramp-get-connection-process v) "remote-path" nil) (tramp-get-connection-property v "remote-path" nil)) - ":")) + path-separator)) (getenv "PATH")))) (eval-after-load "esh-util" --=-=-=--