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

Re: functions -t



On Tue, Oct 12, 2021 at 8:07 PM Pier Paolo Grassi <pierpaolog@xxxxxxxxx> wrote:
>
>> > trace_funcname
>> funcname is executed and traced
>> > funcname
>> funcname is executed and traced (but I was expecting no tracing here)
>>
>> is this expected behaviour

Yes.  Tracing of individual functions is not an option controlled by
setopt.  Only the latter are restored by using "setopt localoptions".

>> and how can I disable the tracing after trace_funcname has exited without using functions +t funcname manually, if is possible?

It's not clear what you mean by "manually" ... so how about:

trace_funcname(){
  emulate -L zsh # or not
  {
    functions -T funcname
    funcname
  } always {
    functions +T funcname
  }
}




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