From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26224 invoked from network); 23 Aug 2021 23:24:05 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Aug 2021 23:24:05 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1629761045; b=Zy5ZNj4QLyBxVTgWuNH01SdlTkHdlA+/HEjYPQG+fQYe5M0KgeRm4i4pN7ULhfZVbTVap4eZGm X1MOa4NCa8dEA6SY3uLUkhMSbpkNXQnJA3j9MbShR9L6jth3Avyawm8FpjT3ibKNbZ1npcTMF2 9AEq13551VOZNbdkrflcYAghGzizrAoqn7QP8r8DzIZTYHiTPonH/UszV/muujruWyRu+9sD/h 2VQEouKvCEYbNjLrrOKzWyWkVptju/8GqBhD297gicmJ0VBumBjvVosR2LI33f4093v8x3XPo4 NqvZfvOgIa3VzNwLbMtdxY7wxSsz76iAywJ8u+UyKDnlzA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wm1-f43.google.com) smtp.remote-ip=209.85.128.43; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1629761045; bh=OU6zqm05AjiGTZtEyzreuYB6XksBRLXI17dc78F3Ai0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=basNycBFC306Iv9ex9pIFbCe4HobGgeG95eODsMuhmTHzI9O7u9YfLyK91IKYyODwrTvc5C3nJ 5gIeQv+zGmftyETkTb4VPUYOVqZf2/4teHPuoXRnTm0z0NS3zwdbmgv3QSMThN+kSWATA3IbBM fm0wjzTrU5ryCgkpbVarD3yg8YZLy2tJ1skJZWTlyIQfMxesmBkf7cOTA9SPHVC2zb0pSvEM1z fw0DwVjhfIbXdz/utTd7yJ66hMhmg7SDmJ8HbvqmN7rj1i1ChSigif/Kr7/1hYaO/OGehX0uYF ay1AzivbwXMfJUUmVXB91Cegfm0geaDZg8sIJiPO1XtA8g==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=DdGuKvceW82fmenUg+TaoyCCNvryQmpUuXwXh7sNz7U=; b=mY7cKLIuh/mv4AMm93Pdp8MDu8 GifgiKoFYa7IYANEBC3kG3l7DIM8fbWtSRAq+9esHKGu0u4YC/SX+VzB1h32+C3pj4DWY/eq1i0Ri XLCBx7AVIyzVkeM4b+lcMnlPU2B2uaZVrD5CrK7Ku5FPKPo6c65VEWsDqPrxXIX1r73ER0XKbBc39 XPXie3IgZZSjKupjLiivkK35WGtovNFuSNwekYGRM00BfccBrI/VoVp5L+ZGIOV9Cn0cL3jdTFw0v QtgJGNXqNgZZrUgwumo8pnZKDUIsDRUlpYn+CyPm4dHeOR1DQhEPKhnKFPjF90/ro8ygAQENU3yLW Jh7+Ge1w==; Received: from authenticated user by zero.zsh.org with local id 1mIJIR-000DBD-S2; Mon, 23 Aug 2021 23:24:03 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wm1-f43.google.com) smtp.remote-ip=209.85.128.43; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-wm1-f43.google.com ([209.85.128.43]:34500) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mIJHe-000CUE-Fm; Mon, 23 Aug 2021 23:23:15 +0000 Received: by mail-wm1-f43.google.com with SMTP id v20-20020a1cf714000000b002e71f4d2026so758817wmh.1 for ; Mon, 23 Aug 2021 16:23:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DdGuKvceW82fmenUg+TaoyCCNvryQmpUuXwXh7sNz7U=; b=Cl6npIUo76DznBLtMuxBwwSjgOCWQ0BqvpTqAFckf7JUbRHWhy0+/ugJXJ0+XnKAgZ NU00QK6V3KFS0WNp5ePftPSX9dqNN8Kgx6LXb5vccEicyXUM3tobV+gooQ091aPzLYZS Agxd+MSJYfd+aU0kCSaT4ebsCqOvWSM8SrWEquylFsCVPFxr4o47XMnCsIeNKgZSGtS5 H3PcQAl3IIDCFa3QpsHGhsGjK5Eu1IbkHJeQNqkBOVlcuXpisbRrdLDaPOzIIPaBSAVO s6YaZ+RjGPMEQXP7XlXQtyGn9kqvFLed+0YeToiP4S2csy3Rc7pRFbZ22JIpz07ly8Rh /y+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DdGuKvceW82fmenUg+TaoyCCNvryQmpUuXwXh7sNz7U=; b=qrUC302yDt5KxKrq1EIxJP1K7B41vMo0M5zSWJAW3PbnXZViHJhZIXK7xrRiqf2Vtm XCslDto72Dsz1c2XOadkQtSVaLJ8B1lzeQ/3QQbHV4SVOb7me/dUGlVOYNqX+7Gwtx6P 8BnkfwCtE/0sxnL0qtMhVNj5KXk2LFs96kLZSbOoH4aaJT7D1uk0BXUR0IpGZeQK+8Yg Kd/aTh/PRm9lpLoU2axZ2JUg4m7JFeVqjayB3yrxDK/HHFvrqlduT700e2Znzq/CkWnJ nm49j8QR/CoXt4I9CFHhs6FNqfOK+uGwjE1TbJ3ZRwxwiHkOLg5WQCRF2W6JBqVeDZWV oW0A== X-Gm-Message-State: AOAM530s5cDvMfm2EtylGl4xDrL7yTdfqUxxDhB8J+4PHQdez8JRy2BT XlLh+zbuDQRym+fUBe9OrMBJdrPQZ070Ecr12OVmp9tH X-Google-Smtp-Source: ABdhPJwIoA/MiUG5/rBRaZDdowwvO08YCZQTcJlUS+a8CUbj35RbTunxbn5yG/sQHh1uhNBr+294qAePz8CfzmOuTJE= X-Received: by 2002:a7b:c756:: with SMTP id w22mr1017275wmk.169.1629760993894; Mon, 23 Aug 2021 16:23:13 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Zach Riggle Date: Mon, 23 Aug 2021 18:23:02 -0500 Message-ID: Subject: Re: Prevent a specific function from being xtrace'd To: Bart Schaefer Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 26970 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: >>> local first_line=$(head -1 <<<$ZSH_DEBUG_CMD) > Egad. > local first_line=${ZSH_DEBUG_CMD%%$'\n'*} That's (almost!) the following line! I couldn't quite get it to work, looks like I was missing a $ and the *. Thanks! Zach Riggle Zach Riggle On Mon, Aug 23, 2021 at 3:04 PM Bart Schaefer wrote: > > On Mon, Aug 23, 2021 at 9:42 AM Zach Riggle wrote: > > > > Hello all! > > > > ~~ TL; DR ~~ > > Is there any way to mark or annotate a function such that its internals should not be traced, even if "set -x" or "zsh -x" is used? > > emulate zsh +x -c 'autoload untraced' > > (The name "untraced" is for example, not some sort of extra magic.) > It also works for > > emulate zsh +x -c 'untraced() { ... }' > > but that requires that you're careful about quoting in the function body. > > Of course you can still force tracing back on with > functions -t untraced > or the function internally calling "set -x" etc. > > > I've created a small script[1] that somewhat achieves this effect, with TRAPDEBUG and ZSH_DEBUG_COMMAND > > >> local first_line=$(head -1 <<<$ZSH_DEBUG_CMD) > > Egad. > > local first_line=${ZSH_DEBUG_CMD%%$'\n'*}