Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: query terminal properties on ZLE startup
- X-seq: zsh-workers 53387
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: PATCH: query terminal properties on ZLE startup
- Date: Wed, 26 Feb 2025 23:49:06 +0100
- Archived-at: <https://zsh.org/workers/53387>
- In-reply-to: <CAH+w=7ZxuY9tcuQmD0BdTDzUxdOsdagBJxDh7_ONxMU2Vy56QQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <42572-1740099942.836692@_3BM.v5Iz.JqiS> <F07C8421-2663-440A-82AD-0748D39511B1@kba.biglobe.ne.jp> <CAH+w=7a9hye-2BxQUjkHw-=zFo5T7vXjVwQRnKnKEoZ3W0-_ug@mail.gmail.com> <40483-1740433325.086036@2QZo.3hhS.-9FG> <CAH+w=7Zf3vL6BYg0t61uskLmDD_gOwE7XhuwxB9SSwv+z0qOKw@mail.gmail.com> <69272-1740474756.308875@TCCj.PrGv.2vsI> <CAH+w=7ZJNRy2zV7t4wRhzcnW1jn2LgRKbMByCOrtbr9VVM2emw@mail.gmail.com> <5355-1740527169.384113@fufd.0HLy.otw9> <CAH+w=7ZxuY9tcuQmD0BdTDzUxdOsdagBJxDh7_ONxMU2Vy56QQ@mail.gmail.com>
Bart Schaefer wrote:
> On Tue, Feb 25, 2025 at 3:46 PM Oliver Kiddle <opk@xxxxxxx> wrote:
> >
> > In the current form, there's no setopt but you can disable it all with:
> >
> > .term.extensions=( -query ).
>
> If I'm not mistaken, the terminal probe would take place during
> init_bltinmods() which happens before run_init_scripts() ? So it's
> not actually possible to assign a value to .term.extensions before the
> terminal is probed at startup?
No, it's possible.
The queries take place at the point where the zle module is loaded.
That typically means the first bindkey or zle command in .zshrc. That
provides plenty of scope both to disable query extensions and to add
configuration that depends on the results of queries. I've checked
a --disable-dynamic build of zsh and that makes no difference - a
statically linked module is not setup before it's loaded. As far
as I can see, init_bltinmods() ends up calling autofeatures() on
behalf of the zle module with a features table for the two builtins I
mentioned plus vared. So zle isn't loaded at that point. If there's no
use of those builtins, it gets manually loaded with the first use of
the zleentry() function. I can find one use of that that may precede
run_init_scripts(): if you pass -o vi or -o emacs to zsh. If you think
that corner case is worth being concerned with, it'd probably work to
make ZLE check the option for the initial keymap choice when it loads
and remove the zleentry() call.
It's also possible that zle gets loaded from /etc/zshenv which would be
rather unhelpful. If you want to disable it, ~/.zshenv might be a good
choice.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author