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

Re: segfault due to chpwd_function



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