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

Re: bug report on a Zsh' widget



On Sat, May 20, 2023 at 4:03 PM Budi <budikusasi@xxxxxxxxx> wrote:
>
> if do widget history-search-backward with user entry
>
> sudo n
>
> then shortcut key of that history search, then Zsh complete it with:
>
> sudo connmanctl disable wifi; sudo connmanctl enable wifi

You've misinterpreted history-search-backward.  Doc says:
     Search backward in the history for a line beginning with the first
     word in the buffer.

So history-search-backward is looking for any line beginning with
"sudo", the "n" is ignored.

You want

history-beginning-search-backward
     Search backward in the history for a line beginning with the
     current line up to the cursor.




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