Fish's highlighting of incorrect commands could be better if it highlighted
the characters where the command differs from the closest recognized
command, This could be from left to right, or some more sophisticated
matching algorithm like smallest string manipulation. Use a simple
algorithm if the typed command name is long.

As for suggesting a correction, Zsh's solution (with a Y/n prompt) works
for me. Yes, it is modal, but it's not obtrusive. Typing anything other
than 'y' has the same effect as the original command would, that is, an
error message that the command name does not exist.

An alternative solution is to put the suggested correction in the command
line so the user can press Enter to accept it, or Ctrl+C or Ctrl+U to
erase. If the user types any characters, they would be added to the end of
the command. This is modeless.


On Wed, Dec 5, 2012 at 11:19 PM, ridiculous_fish <
corydo...@ridiculousfish.com> wrote:

> Hi Charlie,
>
> The autosuggestion tries to be smart.
>
> If your command prefixes a history item, that's used as the suggestion.
> Except that, when you run a command, it remembers which arguments are valid
> file paths (possibly relative), and only suggests that command if those
> paths are still valid.
>
> If there is no suggestion from history, it uses the same algorithm as
> tab-completions, except that it cannot expand subcommands, because it would
> be too slow.
>
> Also, 'cd' commands are handled specially, whether from history or
> completions.
>
> Regarding spell checking, at first blush, I think it might be OK as long
> as it's unobtrusive and doesn't do anything modal. It would be very bad to
> put up a prompt that you have to dismiss by typing Y or N. Also remember
> that fish has syntax highlighting and shows invalid commands in red, which
> is a form of spelling suggestions too.
>
> _fish
>
> On Dec 5, 2012, at 9:42 AM, charlie <charlie.m.sand...@gmail.com> wrote:
>
> > How is the word completion determined, is it just the last command
> entered or is it weighted somehow by history usage ?
> >
> > And different topic, what would you think about adding spelling
> suggestions to mistyped commands, some sort of 'did you mean X ?  hit y to
> run this command'
>
>
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to