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

Re: How to add a 'non-escaped' tilde to the completion list



On Mon, Nov 10, 2014 at 10:54 PM, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
>         p*)
>           local -a pts pids
>           local pt dir pid i suf desc
>           pts=( /dev/pts/*(N) )
>           pts=( ${pts#/dev/pts/} )
>           for pt in ${(n)pts}; do
>             pids=( $(pgrep -t pts/$pt zsh) )
>             i=1
>             suf=
>             for pid in $pids; do
>               zstat -A dir +link /proc/$pid/cwd 2> /dev/null
>               desc="$pt$suf:"
>               description+=( "${(r:8:)desc} ${(Q)${(D)dir}}" )
>               vals+=( $pt:$i )
>               (( i++ ))
>               suf="[${i}]"
>             done
>           done
>           print -rl - $vals
>           keepdups=1

These last two lines should not be there :).

-- 
Mikael Magnusson



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