Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: file descriptor completion



_file_descriptors wasn't working properly on Solaris where /proc/$$/fd
exists but it's contents are not symbolic links. This fixes it.

Oliver

Index: Completion/Zsh/Type/_file_descriptors
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Type/_file_descriptors,v
retrieving revision 1.6
diff -u -r1.6 _file_descriptors
--- Completion/Zsh/Type/_file_descriptors	3 Jun 2008 09:30:58 -0000	1.6
+++ Completion/Zsh/Type/_file_descriptors	10 Nov 2008 17:03:08 -0000
@@ -2,9 +2,9 @@
 
 local i fds expl list link sep
 
-for i in {0..9}; [[ -e /dev/fd/$i ]] && fds+=( $i )
+fds=( /dev/fd/<0-9>(N:t) )
 
-if zstyle -T ":completion:${curcontext}:" verbose && [[ -e /proc/$$/fd ]]; then
+if zstyle -T ":completion:${curcontext}:" verbose && [[ -h /proc/$$/fd/$fds[1] ]]; then
   zstyle -s ":completion:${curcontext}:" list-separator sep || sep=--
 
   if zmodload -F zsh/stat b:zstat; then



Messages sorted by: Reverse Date, Date, Thread, Author