Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
remote files completion for scp
- X-seq: zsh-users 6080
- From: Michał Politowski <mpol@xxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: remote files completion for scp
- Date: Tue, 6 May 2003 23:34:16 +0200
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
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@xxxxxxxxxxxxxxxxxxx
Warning: this is a memetically modified message
Messages sorted by:
Reverse Date,
Date,
Thread,
Author