about summary refs log tree commit diff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2002-02-04 18:03:02 +0000
committerClint Adams <clint@users.sourceforge.net>2002-02-04 18:03:02 +0000
commit190aef0e25ecb56bde977dfe75fdc84b4a12c7d4 (patch)
treefb07621e5767a6bd338f9c990941649cfd1675d8 /Completion/Unix/Command
parent2d35fd6ab0228ce2b698d7778c4ae134d7408a67 (diff)
downloadzsh-190aef0e25ecb56bde977dfe75fdc84b4a12c7d4.tar.gz
zsh-190aef0e25ecb56bde977dfe75fdc84b4a12c7d4.tar.xz
zsh-190aef0e25ecb56bde977dfe75fdc84b4a12c7d4.zip
16553: differentiate between files and directories during remote scp completion.
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_ssh9
1 files changed, 7 insertions, 2 deletions
diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh
index 7d1d95d7c..8830db6ee 100644
--- a/Completion/Unix/Command/_ssh
+++ b/Completion/Unix/Command/_ssh
@@ -3,11 +3,16 @@
 _remote_files () {
   # This is extremely simple-minded; could parse "ls -F" output to do
   # colorings and LIST_TYPES and so on, but I'm just not that ambitious.
-  local expl
+  local expl remfiles
 
   if zstyle -T ":completion:${curcontext}:" remote-access; then
+    remfiles=(${(f)"$(ssh -a -x ${words[CURRENT]%:*} ls -d1F ${words[CURRENT]#*:}\*)"})
+
     _wanted files expl 'remote files' \
-        compadd $(ssh -a -x ${words[CURRENT]%:*} echo ${words[CURRENT]#*:}\*)
+      compadd ${${remfiles:#*/}/[*=@](#e)/}
+
+    _wanted dirs expl 'remote directories' \
+      compadd -S/ ${${(M)remfiles:#*/}/\\/(#e)/}
   else
     _message 'remote files'
   fi