Subject: Re: bug#65356: 30.0.50; [wishlist] Support Tramp method, user name and host name completion in eshell

From: Jim Porter <[email-masked]>
Date: Thu, 17 Aug 2023 20:31:54 -0700

X-Debbugs-Cc: [email-masked]

On 8/17/2023 11:01 AM, Michael Albinus wrote:
> In eshell, this feature does not exist. I would like if I could type
> "cd /ss TAB" and could see the same offering of "ssh:", "sshfs:" and
> "sshx:". Same for user name and host name.
> 
> The appended patch does this for me. I have no idea how good it fits
> into the eshell machinery, for example whether there are problems with
> the em-elecslash.el module. Comments welcome!

Thanks. This would be a useful feature indeed. I have a couple of main 
concerns, which I'm not quite sure what to do about at the moment:

1) Should this go in the Eshell Tramp extension module? Currently, that 
module is there to add built-in versions of su/sudo/doas, as an 
alternative to the "standard" Eshell way of connecting to a remote host: 
"cd /ssh:user@host:~". Therefore, I think we'd want tab-completion of 
Tramp file names even (or especially!) when the Tramp extension module 
is disabled (which is the default).

2) I'm not sure 'pcomplete-try-first-hook' is the right way to enable 
this. Pcomplete has quite a few ways of performing completions, and it 
already knows when it should specifically complete file names (as 
opposed to "--options" for example). Maybe we should enhance Pcomplete 
itself so that you can opt into completion of remote file names too? 
Then when you tab-complete in Eshell, it would just work in all the 
contexts where you can normally complete a file name. I Cc'ed Stefan 
since he might have some thoughts on the Pcomplete machinery here.