From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25843 invoked by alias); 11 Dec 2009 19:11:53 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 27501 Received: (qmail 7562 invoked from network); 11 Dec 2009 19:11:51 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <091211101118.ZM18639@torch.brasslantern.com> Date: Fri, 11 Dec 2009 10:11:18 -0800 In-reply-to: <0742D8B8-F67E-48F7-BCCC-3F578A78D4B7@fysh.org> Comments: In reply to Joel Bernstein "segfault due to chpwd_function" (Dec 11, 5:36pm) References: <0742D8B8-F67E-48F7-BCCC-3F578A78D4B7@fysh.org> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Joel Bernstein , zsh-workers@zsh.org Subject: Re: segfault due to chpwd_function MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Dec 11, 5:36pm, Joel Bernstein wrote: } Subject: segfault due to chpwd_function } } I found a scenario leading to a segfault caused by a chpwd_function. } The function in question runs to completion when called from } command line directly after the 'cd' command, if it is removed from } chpwd_functions and called manually. The chpwd_function in question } calls the "prompt" function. I suspect the problem is that "prompt" calls "add-zsh-hook -D ..." which is muddling with the hooks arrays while they're still being walked by the hook-processing internals. As a workaround, try setting the prompt theme from the zle-line-init widget; for ex: zle-line-init() { prompt wunjo; zle reset-prompt; zle -R } zle -N zle-line-init Refine by creating the widget in chpwd hooks and deleting it from within itself after the zle -R.