Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: scp completion options



On Thursday 28 June 2018 09:38,
Peter Stephenson <p.stephenson@xxxxxxxxxxx> put forth the proposition:
> On Wed, 27 Jun 2018 11:13:12 +0100
> David Woodfall <dave@xxxxxxxxxxxxxx> wrote:
> > > scp_comp_helper() {
> > >   if [[ CURRENT -gt 2 && $words[2] != *:* && ]]; then
> > >     # Complete remotely only...?
> > >     reply=('hosts ????')
> > >   else
> > >     reply=('hosts files')
> > >   fi
> > > }
> > > zstyle -e ':completion:*:complete:scp:*:' tag-order
> > > scp_comp_helper
> >
> > That's giving me an error on the 'if' line:
>
> You need to get rid of the second && --- I originally had another test
> I thought better of but didn't get rid of in the version I copied
> into the e-mail, so it wasn't quite what I actually tried out.
>
> As no-one has come up with anything better I may play with changing
> _remote_files to use the tag remote-files and see if that helps.
>
> pws
>
>

Thanks. It seems to do the trick.

I've still to discover why sometimes remote names get escape for no
apparent reason. eg I have a patch on the remote named:

0001-fix-typo-in-rc.geomyidae-slackware-init-script.patch

This is the first item completed after hitting tab, but it is listed
as

^[k*^[\0001-fix-typo-in-rc.geomyidae-slackware-init-script.patch

in the completion menu, and like

\$\'\\033\'k\\\*\$\'\\033\'\\\\0001-fix-typo-in-rc.geomyidae-slackware-init-script.patch

On the command line after the 'host:'

It's obviously an escape code, and I do use a few, but I can't find
anything with a 'k' or *$ in it.

-Dave

--

Not me, guy.  I read the Bash man page each day like a Jehovah's Witness reads
the Bible.  No wait, the Bash man page IS the bible.  Excuse me...
  -- More on confusing aliases, taken from comp.os.linux.misc

                                                            .--.  oo
                                                           (____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'



Messages sorted by: Reverse Date, Date, Thread, Author