GNU bug report logs - #33791
26.1; Eshell on Windows connecting to GNU/Linux machine using TRAMP and plink: env: ‘c:/home/jordan/test.sh’: No such file or directory

Previous Next

Package: emacs;

Reported by: Jordan Wilson <jordan.t.wilson <at> gmx.com>

Date: Tue, 18 Dec 2018 15:02:01 UTC

Severity: minor

Merged with 24787

Found in versions 25.1, 26.1

Fixed in version 26.2

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #64 received at 33791 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jordan Wilson <jordan.t.wilson <at> gmx.com>
Cc: 33791 <at> debbugs.gnu.org, michael.albinus <at> gmx.de
Subject: Re: bug#33791: 26.1; Eshell on Windows connecting to GNU/Linux
 machine using TRAMP and plink: env: ‘c:/home/jordan/test.sh’: No such file or directory
Date: Sat, 29 Dec 2018 11:10:52 +0200
> From: Jordan Wilson <jordan.t.wilson <at> gmx.com>
> Cc: michael.albinus <at> gmx.de,  33791 <at> debbugs.gnu.org
> Date: Fri, 28 Dec 2018 19:25:59 +0000
> 
> - Have putty in $PATH (version 0.70 on my machine)
> - Load Eli's/Michael's patched files.el (error appears regardless)
>     (load "files.el")
> - M-x eshell
> - connect to GNU/Linux machine using plink:
>       /plink:jordan <at> domain.com:/home/jordan/
> - run executable in working directory
>       ./test.sh
> returns "env: ‘c:/home/jordan/test.sh’: No such file or directory"

Right, I see this as well.

Michael, I need your help here.  The problem is in this part of
eshell-gather-process-output:

    (cond
     ((fboundp 'start-file-process)
      (setq proc
	    (let ((process-connection-type
		   (unless (eshell-needs-pipe-p command)
		     process-connection-type))
		  (command (file-local-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))))

The problem is that file-local-name returns a Unix-style absolute file
name /foo/bar/baz, and the following expand-file-name call then
prepends a drive letter on Windows, because there's no longer any sign
of COMMAND being a remote file, and so expand-file-name doesn't invoke
the Tramp handler.

The simplest fix is to remove the expand-file-name call.  I don't
understand why it is there, but the claim that start-process cannot
deal with relative file names is definitely false.  This code was
there since June 2000, when eshell-gather-process-output was first
written.  Do you see any reason why we'd need to call expand-file-name
here?

Btw, isn't it confusing that start-file-process needs only the "local"
part of COMMAND?  Why cannot its handler DTRT internally instead?

Thanks.




This bug report was last modified 6 years and 197 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.