From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15869 invoked by alias); 28 Jun 2018 20:15:06 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23513 Received: (qmail 8088 invoked by uid 1010); 28 Jun 2018 20:15:06 -0000 X-Qmail-Scanner-Diagnostics: from know-smtprelay-omc-7.server.virginmedia.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(80.0.253.71):SA:0(-1.9/5.0):. Processed in 1.380512 secs); 28 Jun 2018 20:15:06 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: dave@dawoodfall.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Originating-IP: [82.40.94.2] X-Authenticated-User: X-Spam: 0 X-Authority: v=2.3 cv=YrwhubQX c=1 sm=1 tr=0 a=EH02hVpzcg1gP5HQFHlsKw==:117 a=EH02hVpzcg1gP5HQFHlsKw==:17 a=IkcTkHD0fZMA:10 a=hD80L64hAAAA:8 a=a1Uoi5jeAAAA:8 a=YCB211s3yxK1jxPwZpkA:9 a=QEXdDO2ut3YA:10 a=b5GIbgGVya4qEPgWM5ed:22 Date: Thu, 28 Jun 2018 21:14:57 +0100 From: David Woodfall To: zsh-users@zsh.org Subject: Re: scp completion options Message-ID: <20180628201457.GG21870@blackswan> Mail-Followup-To: zsh-users@zsh.org References: <20180626230654.GK11049@blackswan> <20180627081516eucas1p200d804de13d1e5a4f7ea223ecb2d9c49~79k6870Wv1727517275eucas1p2j@eucas1p2.samsung.com> <20180627101312.GL11049@blackswan> <20180628083835eucas1p2cb57feab1bca1540ed0a89cd6e26b9bb~8RikRcvz81808218082eucas1p2p@eucas1p2.samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180628083835eucas1p2cb57feab1bca1540ed0a89cd6e26b9bb~8RikRcvz81808218082eucas1p2p@eucas1p2.samsung.com> User-Agent: Mutt/1.10+32 (ef19f486) (2018-06-19) X-CMAE-Envelope: MS4wfHGXWZ9X9wuXY1FsNSuHYfv2nVnyA907jlYHYDJVLsj1p6wjyatexGCFi9DW733Mfmx2xBVSCFxGgl4mc0AIIvARzlIr9BrL66rqtWwuSqo5oS3c9zJe Q9+AxO26Wx5/pTDyNbVBI8augQmsOHpbjG0= On Thursday 28 June 2018 09:38, Peter Stephenson put forth the proposition: > On Wed, 27 Jun 2018 11:13:12 +0100 > David Woodfall 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 (____)// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'