zsh-workers
 help / color / mirror / Atom feed
* Did something change about completion and xtrace ?
@ 2021-02-06  5:03 Bart Schaefer
  2021-02-10 18:01 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2021-02-06  5:03 UTC (permalink / raw)
  To: Zsh hackers list

I would have sworn that completion used to suppress xtrace output
somehow, but recently if I happen to hit tab after "set -x" I get
everything from _main_complete on down dumped to the terminal.

Am I just conjuring a false memory, or does someone recall a change
that would have affected this?  It could have been quite some time
ago.


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

* Re: Did something change about completion and xtrace ?
  2021-02-06  5:03 Did something change about completion and xtrace ? Bart Schaefer
@ 2021-02-10 18:01 ` Bart Schaefer
  2021-02-10 19:07   ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2021-02-10 18:01 UTC (permalink / raw)
  To: Zsh hackers list

On Fri, Feb 5, 2021 at 9:03 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> I would have sworn that completion used to suppress xtrace output

This is what I was thinking of:

commit 22faf1fa4b1290f5f7f7389bbef33acc2fcdce05
Author: Bart Schaefer <barts@users.sourceforge.net>
Date:   Sun Jul 8 00:32:12 2001 +0000

    Suppress XTRACE during user-defined widgets.

:100644 100644 1d3f346ab d46d3b537 M    Src/Zle/zle_main.c

That has stopped working for completion at some point.  "git blame"
doesn't find any C-code diffs that would matter, at least not in
zle_main.c.

Is there something more than just toggling opts[XTRACE] now required?
Ideas where to look?


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

* Re: Did something change about completion and xtrace ?
  2021-02-10 18:01 ` Bart Schaefer
@ 2021-02-10 19:07   ` Bart Schaefer
  2021-02-10 21:53     ` Phil Pennock
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2021-02-10 19:07 UTC (permalink / raw)
  To: Zsh hackers list

On Wed, Feb 10, 2021 at 10:01 AM Bart Schaefer
<schaefer@brasslantern.com> wrote:
>
> Is there something more than just toggling opts[XTRACE] now required?
> Ideas where to look?

So evidently (?) this never worked with completion.  Finally tracked
it down with gdb.

The following seems to "fix" it and does not interfere with
_complete_debug.  Any objections?

diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index 958fef8e7..5162d97dc 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -821,6 +821,7 @@ callcompfunc(char *s, char *fn)
        sfcontext = SFC_CWIDGET;
        NEWHEAPS(compheap) {
            LinkList largs = NULL;
+           int oxt = isset(XTRACE);

            if (*cfargs) {
                char **p = cfargs;
@@ -830,7 +831,9 @@ callcompfunc(char *s, char *fn)
                while (*p)
                    addlinknode(largs, dupstring(*p++));
            }
+           opts[XTRACE] = 0;
            cfret = doshfunc(shfunc, largs, 1);
+           opts[XTRACE] = oxt;
        } OLDHEAPS;
        sfcontext = osc;
        endparamscope();


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

* Re: Did something change about completion and xtrace ?
  2021-02-10 19:07   ` Bart Schaefer
@ 2021-02-10 21:53     ` Phil Pennock
  2021-02-10 23:02       ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Phil Pennock @ 2021-02-10 21:53 UTC (permalink / raw)
  To: zsh-workers

On 2021-02-10 at 11:07 -0800, Bart Schaefer wrote:
> So evidently (?) this never worked with completion.  Finally tracked
> it down with gdb.
> 
> The following seems to "fix" it and does not interfere with
> _complete_debug.  Any objections?

The main reason I ever enable xtrace at a prompt, instead of in a
script, is to hit tab and see what's happening with completion and where
the logic is flowing.  Would that still be possible with this change?

-Phil


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

* Re: Did something change about completion and xtrace ?
  2021-02-10 21:53     ` Phil Pennock
@ 2021-02-10 23:02       ` Bart Schaefer
  2021-02-11 23:49         ` Phil Pennock
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2021-02-10 23:02 UTC (permalink / raw)
  To: zsh-workers

On Wed, Feb 10, 2021 at 1:53 PM Phil Pennock
<zsh-workers+phil.pennock@spodhuis.org> wrote:
>
> On 2021-02-10 at 11:07 -0800, Bart Schaefer wrote:
> > The following seems to "fix" it and does not interfere with
> > _complete_debug.  Any objections?
>
> The main reason I ever enable xtrace at a prompt, instead of in a
> script, is to hit tab and see what's happening with completion and where
> the logic is flowing.  Would that still be possible with this change?

With this change, you'd have to use the _complete_debug widget
(default bound to control-x question-mark), or selectively enable
tracing with for example

functions -T _complete

(which is probably preferable to tracing the entire thing anyway?)


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

* Re: Did something change about completion and xtrace ?
  2021-02-10 23:02       ` Bart Schaefer
@ 2021-02-11 23:49         ` Phil Pennock
  0 siblings, 0 replies; 6+ messages in thread
From: Phil Pennock @ 2021-02-11 23:49 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

On 2021-02-10 at 15:02 -0800, Bart Schaefer wrote:
> functions -T _complete
> 
> (which is probably preferable to tracing the entire thing anyway?)

... ... yes, yes it is, that is great, thank you.

-Phil


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

end of thread, other threads:[~2021-02-11 23:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-06  5:03 Did something change about completion and xtrace ? Bart Schaefer
2021-02-10 18:01 ` Bart Schaefer
2021-02-10 19:07   ` Bart Schaefer
2021-02-10 21:53     ` Phil Pennock
2021-02-10 23:02       ` Bart Schaefer
2021-02-11 23:49         ` Phil Pennock

zsh-workers

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ http://inbox.vuxu.org/zsh-workers \
		zsh-workers@zsh.org
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


code repositories for the project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git