GNU bug report logs - #31704
26.1; tramp-remote-path/shell: broken executable completion

Previous Next

Package: emacs;

Reported by: xristos <xristos <at> sdf.org>

Date: Mon, 4 Jun 2018 07:24:02 UTC

Severity: normal

Tags: fixed

Found in version 26.1

Fixed in version 27.1

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31704 in the body.
You can then email your comments to 31704 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31704; Package emacs. (Mon, 04 Jun 2018 07:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to xristos <xristos <at> sdf.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 04 Jun 2018 07:24:02 GMT) Full text and rfc822 format available.

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

From: xristos <xristos <at> sdf.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1; tramp-remote-path/shell: broken executable completion
Date: Sun, 03 Jun 2018 21:32:09 -0400
The issue lies in shell--command-completion-data which is called
by shell-command-completion, it only checks directories in
exec-path (local) rather than tramp-remote-path. This bug also
leaks the local exec-path to the remote server.

To reproduce:

emacs -Q

Evaluate:
(require 'tramp)

;; For debugging
(setq tramp-persistency-file-name nil
      tramp-verbose 10)

(add-to-list 'tramp-remote-path 'tramp-own-remote-path)

;; Assuming an account 'chris' exists at server 'remote',
;; to see the issue clearly make sure that there exists
;; a directory in the remote server PATH (e.g. ~/bin/)
;; but NOT in exec-path.

(let ((default-directory "/ssh:chris <at> remote:"))
  (shell "*remote*"))

;; Assuming executable 'testbin' exists in remote server ~/bin/
;; and not inside any directory in exec-path:

remote$ testb<TAB> ;; No completion

M-:
(add-to-list 'exec-path "~/bin/")

remote$ testb<TAB> ;; Completes fine

If one checks the tramp debug buffer, one will see tramp
checking (and leaking information to the remote server)
all the directories that exist in the local exec-path.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31704; Package emacs. (Tue, 05 Jun 2018 09:59:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: xristos <xristos <at> sdf.org>
Cc: 31704 <at> debbugs.gnu.org
Subject: Re: bug#31704: 26.1;
 tramp-remote-path/shell: broken executable completion
Date: Tue, 05 Jun 2018 11:58:37 +0200
xristos <xristos <at> sdf.org> writes:

Hi,

> The issue lies in shell--command-completion-data which is called
> by shell-command-completion, it only checks directories in
> exec-path (local) rather than tramp-remote-path. This bug also
> leaks the local exec-path to the remote server.

I have been bitten several times over the last years by this
problem. Not enough energy to track it down.

I will take your bug report as motivation to give it a try for
fixing. Likely not Just Now, but next time, somehow. I fear, there's no
simple solution.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31704; Package emacs. (Wed, 20 Jun 2018 10:18:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: xristos <xristos <at> sdf.org>
Cc: 31704 <at> debbugs.gnu.org
Subject: Re: bug#31704: 26.1;
 tramp-remote-path/shell: broken executable completion
Date: Wed, 20 Jun 2018 12:17:23 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

Hi,

>> The issue lies in shell--command-completion-data which is called
>> by shell-command-completion, it only checks directories in
>> exec-path (local) rather than tramp-remote-path. This bug also
>> leaks the local exec-path to the remote server.
>
> I have been bitten several times over the last years by this
> problem. Not enough energy to track it down.
>
> I will take your bug report as motivation to give it a try for
> fixing. Likely not Just Now, but next time, somehow. I fear, there's no
> simple solution.

Finally, I've implemented this. If you have a chance to build Emacs from
the git repository, you could try it.

Best regards, Michael.




Added tag(s) fixed. Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Thu, 21 Jun 2018 11:55:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31704; Package emacs. (Wed, 25 Jul 2018 03:34:01 GMT) Full text and rfc822 format available.

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

From: fangtao0901 <fangtao0901 <at> gmail.com>
To: michael.albinus <at> gmx.de
Cc: 31704 <at> debbugs.gnu.org
Subject: bug#31704 fixed commit not handle eshell-path-env properly in
 Windows platform
Date: Wed, 25 Jul 2018 11:24:03 +0800
[Message part 1 (text/plain, inline)]
Hi, Michael  I'm using git master branch daily build emacs on Windows platform, after this commit to fix bug#31704, running commands directly in eshell always gives output "command not found".  The cause of this is in lisp/net/tramp.el, function tramp-eshell-directory-change modify eshell-path-env not properly:  (mapconcat 'identity (butlast (tramp-compat-exec-path)) ":")  I think variable path-separator should be used instead of ":"
Best regards,
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31704; Package emacs. (Wed, 25 Jul 2018 09:04:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: fangtao0901 <fangtao0901 <at> gmail.com>
Cc: 31704 <at> debbugs.gnu.org
Subject: Re: bug#31704: fixed commit not handle eshell-path-env properly in
 Windows platform
Date: Wed, 25 Jul 2018 11:03:27 +0200
fangtao0901 <fangtao0901 <at> gmail.com> writes:

> Hi, Michael

Hi,

>   I'm using git master branch daily build emacs on Windows platform,
> after this commit to fix bug#31704, running commands directly in
> eshell always gives output "command not found".
>   The cause of this is in lisp/net/tramp.el, function
> tramp-eshell-directory-change modify eshell-path-env not properly:
>   (mapconcat 'identity (butlast (tramp-compat-exec-path)) ":")
>   I think variable path-separator should be used instead of ":"

I confirm the problem. However, your proposal doesn't fix it for me.

Are you sure this is a new problem? I've tried Emacs 26.1 on MS Windows,
and I get a similar error.

> Best regards,

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31704; Package emacs. (Thu, 26 Jul 2018 04:38:01 GMT) Full text and rfc822 format available.

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

From: Tao Fang <fangtao0901 <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: "31704 <at> debbugs.gnu.org" <31704 <at> debbugs.gnu.org>
Subject: Re: bug#31704: fixed commit not handle eshell-path-env properly in
 Windows platform
Date: Thu, 26 Jul 2018 12:37:33 +0800
[Message part 1 (text/plain, inline)]
Hi, Michael >   Are you sure this is a new problem? Yes, previous code snippet using (getenv "PATH") when tramp not involved which is right result, I've tested this by revert this commit. >   I've tried Emacs 26.1 on MS Windows, and I get a similar error. Have you added related path to PATH environment variable, e.g. d:\emacs-26.1-x86_64\bin ? I've download Emacs 26.1 from http://ftp.gnu.org/gnu/emacs/windows/emacs-26/emacs-26.1-x86_64.zip and it shows fine. Best regards,
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31704; Package emacs. (Thu, 06 Sep 2018 10:22:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Tao Fang <fangtao0901 <at> gmail.com>
Cc: "31704 <at> debbugs.gnu.org" <31704 <at> debbugs.gnu.org>
Subject: Re: bug#31704: fixed commit not handle eshell-path-env properly in
 Windows platform
Date: Thu, 06 Sep 2018 12:21:08 +0200
Tao Fang <fangtao0901 <at> gmail.com> writes:

> Hi, Michael

Hi,

>> I've tried Emacs 26.1 on MS Windows, and I get a similar error. 
> Have you added related path to PATH environment variable, e.g.
> d:\emacs-26.1-x86_64\bin ? I've download Emacs 26.1 from
> http://ftp.gnu.org/gnu/emacs/windows/emacs-26/emacs-26.1-x86_64.zip
> and it shows fine.

I've committed a patch to the master branch to fix this problem for MS
Windows. I've fixed also a second problem, where Emacs has prefixed
remote file names with the MS Windows volume letter.

Could you pls check?

> Best regards, 

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31704; Package emacs. (Mon, 10 Sep 2018 00:52:02 GMT) Full text and rfc822 format available.

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

From: Tao Fang <fangtao0901 <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: "31704 <at> debbugs.gnu.org" <31704 <at> debbugs.gnu.org>
Subject: Re: bug#31704: fixed commit not handle eshell-path-env properly in
 Windows platform
Date: Mon, 10 Sep 2018 08:50:55 +0800
[Message part 1 (text/plain, inline)]
Hi, Michael  I can confirm this bug was fixed in your commit and second problem fixed either, thanks! Best regards, On 09/06/2018 18:21, Michael Albinus wrote: Tao Fang <fangtao0901 <at> gmail.com> writes: > Hi, Michael Hi, >> I've tried Emacs 26.1 on MS Windows, and I get a similar error. > Have you added related path to PATH environment variable, e.g. > d:\emacs-26.1-x86_64\bin ? I've download Emacs 26.1 from > http://ftp.gnu.org/gnu/emacs/windows/emacs-26/emacs-26.1-x86_64.zip > and it shows fine. I've committed a patch to the master branch to fix this problem for MS Windows. I've fixed also a second problem, where Emacs has prefixed remote file names with the MS Windows volume letter. Could you pls check? > Best regards, Best regards, Michael.
[Message part 2 (text/html, inline)]

Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Mon, 10 Sep 2018 07:55:01 GMT) Full text and rfc822 format available.

Notification sent to xristos <xristos <at> sdf.org>:
bug acknowledged by developer. (Mon, 10 Sep 2018 07:55:02 GMT) Full text and rfc822 format available.

Message #33 received at 31704-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Tao Fang <fangtao0901 <at> gmail.com>
Cc: 31704-done <at> debbugs.gnu.org
Subject: Re: bug#31704: fixed commit not handle eshell-path-env properly in
 Windows platform
Date: Mon, 10 Sep 2018 09:54:43 +0200
Version: 27.1

Tao Fang <fangtao0901 <at> gmail.com> writes:

> Hi, Michael

Hi,

>  I can confirm this bug was fixed in your commit and second problem
> fixed either, thanks!

Thanks for your confirmation, I'm closing the bug.

> Best regards,

Best regards, Michael. 




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 08 Oct 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 201 days ago.

Previous Next


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