Zsh Mailing List Archive
Messages sorted by:
Re: trailing slash in scp completions
- X-seq: zsh-workers 14694
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: Adam Spiers <adam@xxxxxxxxxx>, zsh workers mailing list <zsh-workers@xxxxxxxxxxxxxx>
- Subject: Re: trailing slash in scp completions
- Date: Sun, 3 Jun 2001 19:16:50 +0000
- In-reply-to: <20010601215540.A14573@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20010601215540.A14573@xxxxxxxxxxxxxxxxxxxxxxx>
On Jun 1, 9:55pm, Adam Spiers wrote:
} Might there be time to squeeze in a fix for this before 4.0.1?
You were a couple of hours too late.
} $ scp my.remote.host:rem<TAB>
} $ scp my.remote.host:remote_dir
} The completion works fine, but doesn't add a trailing slash.
The problem is that there's no reliable way for zsh to ask the remote
host what names are files and what names are directories. It doesn't
even know what the shell on the remote host is. So right now this
completion is extremely simplistic (see _remote_files in C/U/C/_ssh);
it doen't even work consistently for complete_in_word, much less with
case-folding match specs and approximation and the like.
This is similar to the issues we've been discussing for _man, with the
added complication that `compfiles' cannot come to the rescue and doing
the full glob is potentially even more expensive.
Possible ways to improve it include:
* add zstyles to configure the remote listing command on a per-host-
* cache per-host-per-user the result of $(ssh user@host 'echo $SHELL')
and use a `case' on the shell to choose the remote listing command;
* supply a utility function -- which would have to be loadable from a
well-known fpath, or defined/loaded in the user's ~/.zshenv -- to
perform part of the completion on the remote machine and pass back
the results, and use that only when the remote shell is the proper
version of zsh.
Of these, only the utility function can do very much with matchers and
Bart Schaefer Brass Lantern Enterprises
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by: