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

Re: prevent some lines directly coming from the history from being executed

Vincent Lefevre wrote on Thu, May 26, 2022 at 16:36:02 +0200:
> On 2022-05-25 18:25:40 -0700, Bart Schaefer wrote:
> > On Wed, May 25, 2022 at 1:49 AM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> > > zle -A accept-line real-accept-line
> > 
> > There's the built-in ".accept-line" widget for this sort of thing, so
> > you don't have to create a new alias.
> Is this documented?
> When searching the man pages, I could find only one place where
> such a built-in is used: in the example for recursive-edit.

There's this in compsys.yo:

> Should you need to use the original completion commands, you can still
> bind keys to the old widgets by putting a `tt(.)' in front of the
> widget name, e.g. `tt(.expand-or-complete)'.

And this in mod_complist.yo:

> All movement functions wrap around at the edges; any other zle function not
> listed leaves menu selection and executes that function.  It is possible to
> make widgets in the above list do the same by using the form of the widget
> with a `tt(.)' in front.  For example, the widget `tt(.accept-line)' has
> the effect of leaving menu selection and accepting the entire command line.

but, yes, it should be mentioned in the zle documentation too, not only
in the compsys documentation.

Anyone volunteering to write the patch?



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