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
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 #73 received at 33791 <at> debbugs.gnu.org (full text, mbox):
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Cc: Jordan Wilson <jordan.t.wilson <at> gmx.com>, 33791 <at> debbugs.gnu.org
> Date: Sat, 29 Dec 2018 10:25:37 +0100
>
> > 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.
>
> This is fixed in the master branch already:
>
> --8<---------------cut here---------------start------------->8---
> (cond
> ((fboundp 'start-file-process)
> (setq proc
> (let ((process-connection-type
> (unless (eshell-needs-pipe-p command)
> process-connection-type))
> ;; `start-process' can't deal with relative filenames.
> (command (file-local-name (expand-file-name command))))
> (apply 'start-file-process
> (file-name-nondirectory command) nil command args)))
> --8<---------------cut here---------------end--------------->8---
>
> The respective commit is
>
> --8<---------------cut here---------------start------------->8---
> commit bca35315e16cb53415649e5c0ac2ec0cc1368679
> Author: Michael Albinus <michael.albinus <at> gmx.de>
> Date: Thu Sep 6 12:16:00 2018 +0200
>
> Fix Bug#31704
>
> * lisp/eshell/esh-proc.el (eshell-gather-process-output): Do not
> let `expand-file-name' prefix remote file names with MS Windows
> volume letter.
>
> * lisp/net/tramp.el (tramp-eshell-directory-change):
> Use `path-separator' as it does eshell. (Bug#31704)
> --8<---------------cut here---------------end--------------->8---
>
> As you see, it requires two changes, in esh-proc.el and tramp.el.
I think both can be cherry-picked to emacs-26.
But do you know why we need expand-file-name here at all? At the very
least, the comment about start-process should be removed, I think.
> > Btw, isn't it confusing that start-file-process needs only the "local"
> > part of COMMAND? Why cannot its handler DTRT internally instead?
>
> 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?
> 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.
> 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
‘process-file’, ‘start-file-process’, or ‘shell-command’.
is IMO unsatisfactory, because it describes how results could be used,
not what they are.
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.