Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Autocorrect for commands with a hyphen (dash) in the name
- X-seq: zsh-users 24856
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Seth Tisue <seth@xxxxxxxxx>
- Subject: Re: Autocorrect for commands with a hyphen (dash) in the name
- Date: Mon, 18 May 2020 17:38:42 -0700
- Cc: Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <CAOoO2vg=-9P7v=ATOzrbh6VF35o_xzK_-yF+EA6OgTHsQBik-A@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAOoO2vg=-9P7v=ATOzrbh6VF35o_xzK_-yF+EA6OgTHsQBik-A@mail.gmail.com>
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