Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] compinit interactive mode overwrites command line
- X-seq: zsh-workers 53615
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Andrea Manenti <andrea.manenti@xxxxxxxxx>
- Cc: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: Re: [BUG] compinit interactive mode overwrites command line
- Date: Tue, 13 May 2025 15:29:13 -0700
- Archived-at: <https://zsh.org/workers/53615>
- In-reply-to: <2YcUA_49imYdO0LSjmj2zUCmqlcDLAVvDpgjGqDAhD96HosnvExjFyoZpGMGwr_VFANw8VzxSKeBxgCHHCmDiB44QuIWt_d1OKktwdlGTGk=@proton.me>
- List-id: <zsh-workers.zsh.org>
- References: <iJtTqY193x0XgWjkT4UpOscJ89ZO5F-auk031rZ6pvhen9BfdP_OP3LcpEKJANzI82SBeIF_IoyQPcOWkpOQH5428NSXm-qcJZej_AlwTUA=@proton.me> <CAHYJk3SG76rK+bZwB7y8qkM2LuA0S77mmRfH0+J+1iTjYtMp8g@mail.gmail.com> <2YcUA_49imYdO0LSjmj2zUCmqlcDLAVvDpgjGqDAhD96HosnvExjFyoZpGMGwr_VFANw8VzxSKeBxgCHHCmDiB44QuIWt_d1OKktwdlGTGk=@proton.me>
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