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

Re: Any way to flag a function such that tracing for it is NOT enabled?



On Mar 28, 11:38am, Pax Unix wrote:
}
} In the documentation, I couldn't find any flag that is the opposite of
} typeset's "-t" option when applied to a function, but that's what I'd
} like.

There's no such thing, but in the specific example of prompts I presume
you're running those functions from precmd, so you can do

    precmd() {
      setopt localoptions no_xtrace no_verbose
      # ... rest of whatever you had in precmd before ...
    }

As you noted you'll still see the trace of the setopt command, but only
once for precmd itself, and thereafter all should be quiet.

If you mean you use "setopt promptsubst" and you have a lot of $(...)
in your PS1 string, well, stop doing that. :-)  Assign a value to
PS1 in precmd instead, or assign to some other variables and refer
to those variables in PS1.



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