magicant / yash

Yet another shell
http://magicant.github.io/yash/
GNU General Public License v2.0
330 stars 30 forks source link

Only add prediction to input line when there is some input #7

Closed aperezdc closed 5 years ago

aperezdc commented 5 years ago

Personally I like the line input prediction feature very useful, but I find it confusing that there is a suggestion on empty input lines. This patch disables showing any prediction on empty input.

I have checked how other shells do this, and for example Zsh with zsh-autosuggestions (screencast) and Fish (screencast) do not show suggestions when the input is empty.


P.S: @magicant, it looks like the main repository for Yash is the Subversion one, so please let me know if you prefer contributions to be sent in some other way instead of GitHub PRs.

magicant commented 5 years ago

Thank you for the patch, @aperezdc .

I know the current behavior can be confusing, but I still find it useful when entering a couple of commands routinely. I'm thinking of adding an option so the user can choose whichever behavior they like.

aperezdc commented 5 years ago

@magicant Maybe I can try to add the option myself tomorrow. Is lepredictempty a good name for it?

magicant commented 5 years ago

Yes, sounds pretty good 👍

aperezdc commented 5 years ago

@magicant I have added the option, and updated the documentation and the tests as well. I hope the PR looks better now :smiley:

magicant commented 5 years ago

Thank you so much. You've done almost everything!

I merged your patch at a429dc9f35e1dd5594ec1675087a9cdc85136dab, and will follow up with an update to the Japanese documentation.

aperezdc commented 5 years ago

@magicant Thanks for applying the patch and for taking care of the Japanese translation. Unfortunately I do not know enough Japanese myself :innocent: