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

Re: precmd, preexec, and supplied prompt themes



On Fri, 12 Oct 2007 17:59:06 -0400
Matthew Wozniski <godlygeek@xxxxxxxxx> wrote:

     On Fri, Oct 12, 2007 at 02:47:23PM -0700, William Scott wrote:
     > Is there a simple way to prepend or append additional arguments to these 
     > (or any) functions?  I've been doing something like this, but it seems 
     > hackish:
     
     Check out the zsh man page, section SPECIAL FUNCTIONS, or just search
     for 'hook function'.  The long and short of it is that the prompt
     themes should be using
     
     typeset -a precmd_functions
     precmd_functions += my_prompt_precmd
     
     and
     
     typeset -a preexec_functions
     preexec_functions += my_prompt_preexec
     
     If you're talking about prompt themes supplied with zsh, I would
     consider it a bug in the package if those aren't defined that way.
     
     ~Matt
     
Thanks.  That seems like a good approach.

These for example all appear to just define a precmd function:

 
prompt_bigfade_setup
 
prompt_elite2_setup
prompt_elite_setup
prompt_fade_setup
prompt_fire_setup
prompt_off_setup
prompt_redhat_setup
prompt_suse_setup
prompt_zefram_setup

The adam1,2, bart and clint ones seem to be doing something else that I suspect is designed to prevent clobbering the function.



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