summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_rsync
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Unix/Command/_rsync')
-rw-r--r--Completion/Unix/Command/_rsync7
1 files changed, 4 insertions, 3 deletions
diff --git a/Completion/Unix/Command/_rsync b/Completion/Unix/Command/_rsync
index 8120c10a9..b6fa296a1 100644
--- a/Completion/Unix/Command/_rsync
+++ b/Completion/Unix/Command/_rsync
@@ -31,13 +31,14 @@ elif [[ -prefix 1 *:: ]]; then
_describe "remote modules" remmodules -S/
elif [[ -prefix 1 *: ]]; then
- local remfiles remdispf remdispd
+ local remfiles remdispf remdispd slash
compset -P 1 '*:'
if zstyle -T ":completion:${curcontext}:" remote-access; then
+ slash=/
remfiles=(${(f)"$(ssh -a -x ${words[CURRENT]%:*} ls -d1F ${${${words[CURRENT
-]#*:}:h}/\\/(#e)/}/\* 2>/dev/null)"})
+]#*:}:h}/${slash}(#e)/}/\* 2>/dev/null)"})
remdispf=(${remfiles:#*/})
remdispd=(${(M)remfiles:#*/})
@@ -46,7 +47,7 @@ elif [[ -prefix 1 *: ]]; then
compadd -d remdispf ${${remfiles:#*/}/[*=@|](#e)/}
_wanted files expl 'remote files and directories' \
- compadd -S/ -d remdispd ${${(M)remfiles:#*/}/\\/(#e)/}
+ compadd -S/ -d remdispd ${${(M)remfiles:#*/}/${slash}(#e)/}
else
_message -e remote-files 'remote files'
fi