From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 22879 invoked from network); 3 May 2020 06:02:12 -0000 Received-SPF: pass (primenet.com.au: domain of zsh.org designates 203.24.36.2 as permitted sender) receiver=inbox.vuxu.org; client-ip=203.24.36.2 envelope-from= Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 3 May 2020 06:02:12 -0000 Received: (qmail 25094 invoked by alias); 3 May 2020 06:02:01 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45765 Received: (qmail 2879 invoked by uid 1010); 3 May 2020 06:02:01 -0000 X-Qmail-Scanner-Diagnostics: from relay12.mail.gandi.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25793. spamassassin: 3.4.4. Clear:RC:0(217.70.178.232):SA:0(-2.6/5.0):. Processed in 3.050359 secs); 03 May 2020 06:02:01 -0000 X-Envelope-From: stephane@chazelas.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _nblcust.gandi.net designates 217.70.178.232 as permitted sender) Date: Sun, 3 May 2020 07:01:13 +0100 From: Stephane Chazelas To: Daniel Shahaf Cc: Bart Schaefer , =?utf-8?B?VGltb3Row6ll?= Mazzucotelli , Peter Stephenson , "zsh-workers@zsh.org" Subject: Re: Feature request: ZSH_XTRACEFD variable Message-ID: <20200503060113.utatw2zz43maff6e@chazelas.org> Mail-Followup-To: Daniel Shahaf , Bart Schaefer , =?utf-8?B?VGltb3Row6ll?= Mazzucotelli , Peter Stephenson , "zsh-workers@zsh.org" References: <1563722540.4311.24.camel@samsung.com> <1565710707.5633.11.camel@samsung.com> <309829031.4459446.1587391766024@mail2.virginmedia.com> <20200503000658.6fddb904@tarpaulin.shahaf.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200503000658.6fddb904@tarpaulin.shahaf.local2> 2020-05-03 00:06:58 +0000, Daniel Shahaf: [...] > P.S. Shouldn't ZSH_XTRACEFD be declared with PM_DONTIMPORT? (assuming PM_DONTIMPORT is about not importing it from the environment) ZSH_XTRACEFD is useful in things like: ZSH_XTRACEFD=7 zsh -x myscript 7> somefile Or ZSH_XTRACEFD=7 zsh -lx 7> somefile to debug start-up file issues. That's the primary way I've been using its bash counterpart. See https://unix.stackexchange.com/search?q=user%3A22565+BASH_XTRACEFD for several examples. bash also allows SHELLOPTS=xtrace BASH_XTRACEFD=7 some-command Which will cause all bash invocations run through some-command (including those running as sh!) to have their xtrace option set. I've used that to debug things like grub-install. I don't think we want to go there with zsh. With zsh, one can always add a: if [[ -n $MYDEBUG ]]; then ZSH_XTRACEFD=7 set -o xtrace fi to their ~/.zshenv to enable this kind of debugging. -- Stephane