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

Re: Did something change about completion and xtrace ?



On Wed, Feb 10, 2021 at 10:01 AM Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> 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();




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