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

Re: [BUG] compinit interactive mode overwrites command line



On Tue, May 13, 2025 at 8:44 AM Andrea Manenti <andrea.manenti@xxxxxxxxx> wrote:
>
> Suppose the command "Foo" can complete to "FooBarLong1", "FooBarLong2", ..., "FooBarLong10",
> "FooSomethingElse". If I want "FooSomethingElse" I would either have to press the right arrow 10
> times or erase FooBarLong1 until Foo pressing backspace 8 times. Whereas if it appears without
> completing I could just type "FooS" until all the FooBarLongss disappear, then press [Enter].

Instead of using interactive mode, you might try using the "predictive
typing" contributed functions.

autoload -Uz predict-on
zle -N predict-on
(choose a key to bind to)

or if you really like it,

autoload -Uz add-zle-hook-widget
add-zle-hook-widget -Uz line-init predict-on

It may not be bug-free but it's shell code using working zle builtins,
so likely easier to tweak and debug.




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