zsh-users
 help / color / mirror / code / Atom feed
* Preventing xtrace / -x from stepping through function from autoload'ed module
@ 2021-08-11  8:36 Zach Riggle
  2021-08-11 17:48 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Zach Riggle @ 2021-08-11  8:36 UTC (permalink / raw)
  To: Zsh Users

Hello again, thanks in advance for the help.

Documentation on "typeset" indicates that with the "-f" flag, "-ft"
should turn ON tracing for that function, and "-fT" should turn OFF
tracing for that function (as long as it is named).

However, quick experimentation doesn't align with my reading of the
docs -- "typeset -ft func" DOES work to enable tracing for that
function, but "typeset -fT func" does NOT disable tracing for that
function (when tracing is enabled globally via e.g. "set -x").

Are my expectations for "typeset -fT" out of line?  Its inverse,
"typeset -ft" does seem to work as I expect it to.

    #!/usr/bin/env zsh

    # Turn ON execution tracing
    set -x

    # Turn OFF execution tracing for the named function, before declaration
    typeset -fT hello

    hello() {
        echo "$@"
    }

    # Turn OFF execution tracing for the named function, after declaration
    # (not sure which order is intended so we try both.)
    typeset -fT hello

    # Testing shows that "hello" is traced, which is NOT expected
    hello "Should not be traced"

    # Turn ON function tracing for hello
    set +x
    typeset -ft hello

    # Testing shows that "hello" is traced, here as expected
    hello "Should be traced"


Zach Riggle


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-11 17:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-11  8:36 Preventing xtrace / -x from stepping through function from autoload'ed module Zach Riggle
2021-08-11 17:48 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).