zsh-users
 help / color / mirror / code / Atom feed
From: "Michał Politowski" <mpol@charybda.icm.edu.pl>
To: zsh-users@sunsite.dk
Subject: remote files completion for scp
Date: Tue, 6 May 2003 23:34:16 +0200	[thread overview]
Message-ID: <20030506213416.GA30800@Amber.lab.icm.edu.pl> (raw)

I believe that this completion needs something, maybe dequoting like this, to work correctly.
Without this it can't complete any remote path segments after one with
spaces, with the change it works for me.

--- /usr/share/zsh/4.0.6/functions/Completion/Unix/_ssh	2003-03-25 15:45:53.000000000 +0100
+++ /home/mike/.zsh/functions/_ssh	2003-05-06 23:18:03.000000000 +0200
@@ -7,5 +7,5 @@
   if zstyle -T ":completion:${curcontext}:" remote-access; then
     zparseopts -D -E -a args p: 1 2 4 6 F:
-    remfiles=(${(M)${(f)"$(ssh $args -a -x ${words[CURRENT]%%:*} ls -d1F ${PREFIX%%[^./][^/]#}\* 2>/dev/null)"}%%[^/]#(|/)})
+    remfiles=(${(M)${(f)"$(ssh $args -a -x ${words[CURRENT]%%:*} ls -d1F ${(Q)PREFIX%%[^./][^/]#}\* 2>/dev/null)"}%%[^/]#(|/)})
     compset -P '*/'
     compset -S '/*' || suf='remote file'



One other thing. I obviously don't understand something about quoting.
Why with foo='a\string\with\some\backslashes'
echo "${foo//'\'/-}"
and
echo "${foo//"\\"/-}"
work but
echo "${foo//\\/-}"
doesn't do any substitutions,
no matter how many backslashes do I actually put in the last one?

-- 
Michał Politowski -- mpol@charybda.icm.edu.pl
Warning: this is a memetically modified message


             reply	other threads:[~2003-05-06 21:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-06 21:34 Michał Politowski [this message]
2003-05-07 10:15 ` Oliver Kiddle
2003-05-07 11:40   ` Michał Politowski
2003-05-07 12:37     ` Oliver Kiddle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030506213416.GA30800@Amber.lab.icm.edu.pl \
    --to=mpol@charybda.icm.edu.pl \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).