Re: [Fish-users] Shell Completion
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 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
Re: [Fish-users] Shell Completion
On Wed, 5 Dec 2012 23:19:36 -0800, ridiculous_fish wrote: > 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. Good point about syntax highlighting. But perhaps it should be noted that it doesn't work for color blind people. They're more common than we tend to assume. On Wed, 5 Dec 2012 14:26:26 -0500, Fred Alger wrote: > I think it'd drive me crazy and I'd immediately turn it off. :-) Hell, me too! :-( -- Luciano ES >> -- 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
Re: [Fish-users] Shell Completion
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 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
Re: [Fish-users] Shell Completion
On Wednesday, 5 December 2012 at 12:42, charlie wrote: > How is the word completion determined, is it just the last command entered or > is it weighted somehow by history usage ? > Not sure. Subjectively seems to be simply "the most recent matching command in history." > 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' I think it'd drive me crazy and I'd immediately turn it off. :-) I use control-W or M-d (*) to forward- or reverse- kill the entire incorrect word, as well as C-a and C-e to move to the start/end of the line and M-f M-b to move the cursor by entire words. Then again, I'm one of those weird Emacs users, and these keys are second nature for me; YMMV. :-) *(M is meta, which is usually "alt" but might be something different depending on your terminal.)-- 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