Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: file descriptor completion
- X-seq: zsh-workers 26022
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxxxxx>
- Subject: PATCH: file descriptor completion
- Date: Mon, 10 Nov 2008 18:09:11 +0100
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:Received:From:To:Subject:Date:Message-ID; b=1/ExJlxTlnrf8U6pmzrTrveK0151Eg+RUO6kEIZo1L7RTOITwuMC9DcINC2MEFgvMe0+0mXfkHs/V/9WFnCuYDBQJm1W8Wf1Q6XfE6f2LNK2Ypn/dGdEtc9/wSnGGFrbunRwbaOzhBIPyJrUu4f2j0AGPIRW2zhBplQzUU/DeIg= ;
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
_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