about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2002-02-05 18:03:24 +0000
committerClint Adams <clint@users.sourceforge.net>2002-02-05 18:03:24 +0000
commit6b932f3cf73c24c14bd25f35575ff9a6f0218fda (patch)
treeea36f91b2d000961577aa48f9a5ea4add3d3f4cd
parentc6d589aadd706b366b5207ac155f83510e5c408e (diff)
downloadzsh-6b932f3cf73c24c14bd25f35575ff9a6f0218fda.tar.gz
zsh-6b932f3cf73c24c14bd25f35575ff9a6f0218fda.tar.xz
zsh-6b932f3cf73c24c14bd25f35575ff9a6f0218fda.zip
16566: show ls -F classifiers as display strings.
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_ssh24
2 files changed, 21 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 8c492e92c..ff790d135 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-02-04  Clint Adams  <clint@zsh.org>
+
+	* 16566: Completion/Unix/Command/_ssh: show ls -F
+	classifiers as display strings.
+
 2002-02-04  Bart Schaefer  <schaefer@zsh.org>
 
 	* 16556: Src/builtin.c: Error messages added in 16503 should not
diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh
index aa73da51b..954a8b391 100644
--- a/Completion/Unix/Command/_ssh
+++ b/Completion/Unix/Command/_ssh
@@ -1,18 +1,26 @@
 #compdef ssh slogin=ssh scp ssh-add ssh-agent ssh-keygen
 
 _remote_files () {
-  # Rather than simple directory discrimination, there should be
-  # coloring based on all the different ls -F classifiers.
-  local expl remfiles
+  # There should be coloring based on all the different ls -F classifiers.
+  local expl remfiles remdispf remdispd
 
   if zstyle -T ":completion:${curcontext}:" remote-access; then
-    remfiles=(${(f)"$(ssh -a -x ${words[CURRENT]%:*} ls -d1F ${words[CURRENT]#*:}\* 2>/dev/null)"})
+    if [[ $options[globdots] == "on" ]] && [[ "$PREFIX" == */ || -z "$PREFIX" ]];
+    then
+      print ssh -a -x ${words[CURRENT]%:*} ls -a1F ${words[CURRENT]#*:}
+      remfiles=(${(f)"$(ssh -a -x ${words[CURRENT]%:*} ls -a1F ${words[CURRENT]#*:} 2>/dev/null)"})
+    else
+      remfiles=(${(f)"$(ssh -a -x ${words[CURRENT]%:*} ls -d1F ${words[CURRENT]#*:}\* 2>/dev/null)"})
+    fi
 
-    _wanted files expl 'remote files' \
-      compadd ${${remfiles:#*/}/[*=@|](#e)/}
+    remdispf=(${remfiles:#*/})
+    remdispd=(${(M)remfiles:#*/})
 
-    _wanted dirs expl 'remote directories' \
-      compadd -S/ ${${(M)remfiles:#*/}/\\/(#e)/}
+    _wanted files expl 'remote files and directories' \
+      compadd -d remdispf ${${remfiles:#*/}/[*=@|](#e)/}
+      
+    _wanted files expl 'remote files and directories' \
+      compadd -S/ -d remdispd ${${(M)remfiles:#*/}/\\/(#e)/}
   else
     _message 'remote files'
   fi