Make autosuggestions from history case-insensitive
For instance, I have directory named Projects in current workind directory. When typing cd pro fish suggests Projects/ as possible completion based on directory name. But when I type cd Pro shell suggests Projects/myproject string from history.
I think it would be more convenient to search for possible completions from history case-insensitively.
Fish version: 2.3.0 Operating system: OS X, Homebrew Terminal or terminal emulator: OS X Terminal
Seems reasonable to me. Most search engines default to case-insensitive and may not even provide a case-sensitive search option. Having fish behave the same way is likely to be less surprising, and thus friendlier, for people used to Google, etc.
Hello, I wish to work on this bug. I haven't contributed to fish-shell before.
I haven't contributed to fish-shell before.
That's okay. We're always interested in seeing people contribute to the core C++ code. We're happy to get you pointed in the right direction by answering questions specific to this project such as how to run unit tests, acceptable code style, etcetera. We're not, however, going to teach you how to use git or program in C++ :smile:
See also issue #2538 which is closely related.
Hi, just wanted to let you know that I really like this behaviour! If I want to lookup the history case insensitive - I just type small letters. And since most of my Directory paths are starting uppercase I can easily search for them with the first letter uppercase. So if this is going to be changed, please make it configurable.
Sorry! I've been pretty busy lately and haven't got to this yet. If someone else is willing to take this up, feel free to do so.
Can I help with this? I really love using the fish shell, and would like to contribute to it :smile:
Sure! Awesome! Please start by describing the behavior you'd like though. For example I'm not sure about suggesting command names in a case insensitive way.
Yeah sure, I think the filenames could be case sensitive, also like while I am at it, I have one other idea/feature request, like while we are in the middle of an incomplete or a half written command, and the shell suggests a completion, could some keybinding automatically execute it? I won't say that pressing enter should 'cause, well, a command like cd could have a lot of suggestions but would work on its own too..
@BK1603 you can make your own key binding if you want to accept and execute. For example here with control-F:
bind \cf accept-autosuggestion execute
Any fix for this should respect existing fish convention with regards to case: case insensitive options should only be shown if no case-matching options are extant/viable.
That's the existing behavior, or at least the intended behavior. See completions_sort_and_prioritize where we try to preserve only the "best" completions.
if no one is working on this I'm gonna take it up so lmk if you are currently working on implementing this
Sounds good. Probably you should describe your proposed UI changes, before you get too far into implementation.
For the time being, I just wanted to try to make it so the autosuggestion for a lowercase word is the same as the autosuggestion for that same word as an uppercase word. For example, When typing cd pro I want the autosuggestion to be the same as typing cd Pro or typing cd PRO
For the time being, I just wanted to try to make it so the autosuggestion for a lowercase word is the same as the autosuggestion for that same word as an uppercase word. For example, When typing
cd proI want the autosuggestion to be the same as typingcd Proor typingcd PRO
This already works: if the best completion is case-insensitive then it will use that. It works with cd and others. The exception is commands from history, which are always matched case-sensitive.