about summary refs log tree commit diff
path: root/Completion/User/_ssh
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-02-22 22:45:51 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-02-22 22:45:51 +0000
commite0c99aa850ef8cee8451354e0314b9e4c5295f5d (patch)
tree65b83eb4a34582d8e3163bd54e92cbf48f2e5192 /Completion/User/_ssh
parent144a234d652e274643875e80994c51cb5247f9cf (diff)
downloadzsh-e0c99aa850ef8cee8451354e0314b9e4c5295f5d.tar.gz
zsh-e0c99aa850ef8cee8451354e0314b9e4c5295f5d.tar.xz
zsh-e0c99aa850ef8cee8451354e0314b9e4c5295f5d.zip
zsh-users/2930
Diffstat (limited to 'Completion/User/_ssh')
-rw-r--r--Completion/User/_ssh8
1 files changed, 7 insertions, 1 deletions
diff --git a/Completion/User/_ssh b/Completion/User/_ssh
index aa4ffb2f6..82f959b37 100644
--- a/Completion/User/_ssh
+++ b/Completion/User/_ssh
@@ -1,5 +1,11 @@
 #compdef ssh slogin scp ssh-add ssh-agent ssh-keygen
 
+_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.
+  compadd $(ssh ${words[CURRENT]%:*} echo ${words[CURRENT]#*:}\*)
+}
+
 _ssh () {
   local curcontext="$curcontext" state lstate line ret=1 expl args tmp
   typeset -A opt_args
@@ -172,7 +178,7 @@ _ssh () {
       return
     elif [[ -n "$state" ]]; then
       if compset -P '*:'; then
-        _files && ret=0
+        _remote_files && ret=0
       elif compset -P '*@'; then
         _wanted hosts expl host && _ssh_hosts -S: "$expl[@]" && ret=0
       else