Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: segfault due to chpwd_function
- X-seq: zsh-workers 27501
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Joel Bernstein <joel@xxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: segfault due to chpwd_function
- Date: Fri, 11 Dec 2009 10:11:18 -0800
- In-reply-to: <0742D8B8-F67E-48F7-BCCC-3F578A78D4B7@xxxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <0742D8B8-F67E-48F7-BCCC-3F578A78D4B7@xxxxxxxx>
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author