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

Re: Autocorrect for commands with a hyphen (dash) in the name



On Mon, May 18, 2020 at 5:16 PM Seth Tisue <seth@xxxxxxxxx> wrote:
>
> ...doesn't work, in either zsh 5.7 or 5.8:
> [...]
> but the same isn't true for underscores:
> [...]
> seems like a bug?

On a quick glance at the code, it appears hyphen is considered to be
"close to" a number, whereas underscore is considered to be "close to"
a letter.  This may have something to do with a long-ago transcription
of a then-common keyboard layout.

Autocorrect isn't really a spelling checker, despite everything that's
said about it.  It's a typographical error checker comparing the
command word to something it can look up in the command hash table.
So it'll fail if the hash table isn't filled yet, or if it decides
your input is too "far away" to be a typo.



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