From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3096 invoked by alias); 8 Nov 2011 14:22:03 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16556 Received: (qmail 7284 invoked from network); 8 Nov 2011 14:21:50 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at trippelsdorf.de does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=mail.ud10.udmedia.de; h= date:from:to:subject:message-id:references:mime-version :content-type:in-reply-to; s=beta; bh=iaTNC8jGR8BfxkiQIqkgAlCyD2 5OsSc3cgoJRDQn/UU=; b=V1RuzFe9tb/TOSkzijG+7nKyCzYWJiNvvdBeR4z27S P4mf+gGqg7U905eOv6xJCRBmTL3w87va4C7ArN2NDX46mPgyBe6nPfD627Qlr/xK wXehtnEiUTjWoIFtUjWYDbyALDDm33ThEW4OTX8s3NXjFczOYb3+3caivYIMLlO0 w= Date: Tue, 8 Nov 2011 15:21:46 +0100 From: Markus Trippelsdorf To: zsh-users@zsh.org Subject: Re: zsh spinning for ages when I hit tab on directory Message-ID: <20111108142146.GC1621@x4.trippels.de> References: <20111108131022.GA1621@x4.trippels.de> <20111108135809.GB1621@x4.trippels.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111108135809.GB1621@x4.trippels.de> On 2011.11.08 at 14:58 +0100, Markus Trippelsdorf wrote: > On 2011.11.08 at 14:10 +0100, Markus Trippelsdorf wrote: > > Zsh is busy spinning for minutes when I hit tab at the end of an > > directory. For example consider: > > ~ % /usr/share/gcc-data/x86_64-pc-linux-gnu/4.7.0/man/man1/ > > man1 % l > > total 1748 > > drwxr-xr-x 2 root 72 Nov 8 13:37 . > > drwxr-xr-x 4 root 28 May 27 15:33 .. > > -rw-r--r-- 1 root 42888 Nov 8 13:37 cpp.1 > > -rw-r--r-- 1 root 824844 Nov 8 13:37 g++.1 > > -rw-r--r-- 1 root 824844 Nov 8 13:37 gcc.1 > > -rw-r--r-- 1 root 24554 Nov 8 13:37 gcov.1 > > > > When position the cursor after the man1/ of > > ~ % /usr/share/gcc-data/x86_64-pc-linux-gnu/4.7.0/man/man1/ > > and hit tab, zsh starts spinning: > > > > 96.79% libzsh-4.3.12.so [.] 0x7185f > > 0.12% [kernel] [k] handle_irq_event_percpu > > 0.07% libFLAC.so.8.2.0 [.] FLAC__bitreader_read_rice_signed_block > > When I zoom into zsh with "perf top" I see: > 69.44% zsh [.] patmatch > 14.15% zsh [.] charrefinc > 9.44% zsh [.] charnext > 6.66% zsh [.] charref Ah, it's the following lines in my .zshrc that are responsible: zstyle ':completion:::::' completer _complete _approximate zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) )' zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b' When I comment out the max-errors zstyle, zsh no longer hangs. So the next question is, how can I get the same behavior as before, but without the long hangs? -- Markus