Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: scp completion options
- X-seq: zsh-users 23513
- From: David Woodfall <dave@xxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: scp completion options
- Date: Thu, 28 Jun 2018 21:14:57 +0100
- In-reply-to: <20180628083835eucas1p2cb57feab1bca1540ed0a89cd6e26b9bb~8RikRcvz81808218082eucas1p2p@eucas1p2.samsung.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mail-followup-to: zsh-users@xxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CGME20180626231957epcas4p275197b8b1b133496936cd1e2a59d15b6@epcas4p2.samsung.com> <20180626230654.GK11049@blackswan> <20180627081516eucas1p200d804de13d1e5a4f7ea223ecb2d9c49~79k6870Wv1727517275eucas1p2j@eucas1p2.samsung.com> <20180627101312.GL11049@blackswan> <20180628083835eucas1p2cb57feab1bca1540ed0a89cd6e26b9bb~8RikRcvz81808218082eucas1p2p@eucas1p2.samsung.com>
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