Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

friendly history searching should be case insensitive #3236

Closed
krader1961 opened this issue Jul 15, 2016 · 12 comments · Fixed by #3460
Closed

friendly history searching should be case insensitive #3236

krader1961 opened this issue Jul 15, 2016 · 12 comments · Fixed by #3460
Assignees
Milestone

Comments

@krader1961
Copy link
Contributor

krader1961 commented Jul 15, 2016

Working on fixing issue #3224 caused me to notice that searching history is case sensitive. So history --search wtf is not the same as history --search WTF. Not very friendly, IMHO. I propose changing the default to case insensitive searching with an option for case sensitive.

Whatever we decide the man page should be updated to document the behavior as it is currently silent on the matter.

@krader1961 krader1961 added this to the fish-future milestone Jul 15, 2016
@krader1961 krader1961 self-assigned this Jul 15, 2016
@krader1961 krader1961 modified the milestones: fish 2.4.0, fish-future Sep 10, 2016
@krader1961
Copy link
Contributor Author

Moving to the 2.4.0 target. I've started work on it and should be done in a few days.

@krader1961 krader1961 modified the milestones: fish-future, fish 2.4.0 Sep 18, 2016
@krader1961
Copy link
Contributor Author

Removing this from the fish 2.4.0 milestone since my work to change how history subcommands are handled took priority. It seems very unlikely that change will be merged in time for me to complete working on this in time for the 2.4.0 release.

@krader1961
Copy link
Contributor Author

I've made more progress on implementing this. It might be possible to implement it in time for the 2.4.0 release but for the fact I have decided to try and see if I can get to root cause for issue #3050 since we've received yet another report of that problem (issue #3406) and I can now reliably reproduce that problem and it does appear to involve the change I made (commit f2246df) to reduce the number of unicode private-use chars that fish reserves.

@zanchey
Copy link
Member

zanchey commented Oct 2, 2016

@krader1961, is this likely to be fixable in the next 48 hours? I am happy to bump it for now.

@ridiculousfish
Copy link
Member

Just noticed this. This seems strange - isn't Unix mostly case-insensitive, so commands that differ only by case aren't related? What's an example of a scenario where you'd want this to be case-insensitive?

@krader1961
Copy link
Contributor Author

is this likely to be fixable in the next 48 hours?

Maybe, but not with unit tests. I've been exploring different approaches and have one that I'm happy with that seems to work well for me. To be determined is whether I've introduced any problems such as memory leaks or performance problems.

Just noticed this. This seems strange - isn't Unix mostly case-insensitive, so commands that differ only by case aren't related?

Traditional UNIX is case-sensitive for almost everything. It is modern variants such as macOS (Mac OS X) that are case-insensitive; at least with respect to file system path names.

@krader1961
Copy link
Contributor Author

krader1961 commented Oct 2, 2016

What's an example of a scenario where you'd want this to be case-insensitive?

Every single history search. When you use Google or some other search engine how often do you, or anyone else, expect the result to be case-sensitive? Yes, I am a grey beard who used to expect such searches to be case-sensitive. But today the reality is that most users expect case-insensitive behavior.

@ridiculousfish
Copy link
Member

(Sorry, I got mixed up. What I wrote should have read "isn't Unix mostly case-sensitive?")

Your observation about Google is well taken, but I would guess that most users still expect the default to be case-sensitive. This would match grep, etc.

@krader1961
Copy link
Contributor Author

It's not obvious that people using the grep command without the -i or --ignore-case options is applicable to this situation. It seems to me, given fish's mission as a "friendly" shell, that most users will expect implicit matches to be case insensitive so as to match their experience with search engines like Google and Yahoo. As a grey-beard who has been using computers since the mid 1970's I sometimes find the current behavior of many applications surprising (e.g., case-insensitive without my explicit say so). But I recognize that my expectations are irrelevant.

@floam
Copy link
Member

floam commented Oct 2, 2016

It is modern variants such as macOS (Mac OS X) that are case-insensitive; at least with respect to file system path names.

Though, what the future may hold: APFS appears to be case insensitive (for now? a bug? Hard to tell.)

@alphapapa
Copy link

My two cents: I prefer case-sensitive filesystems by far. However, for searching history entries, I think case-insensitive-by-default would be more useful. If you're trying to remember a command that acted on a certain path that you don't access frequently, you might not remember whether it has uppercase letters. And why require users to do history | grep -i when the history already has search built-in?

Some of the newer searching/grepping tools are case-insensitive by default, but switch to case-sensitive if uppercase letters are used in the query. That might be a good model for Fish.

@krader1961 krader1961 modified the milestones: fish 2.4.0, fish-future Oct 11, 2016
@zanchey zanchey modified the milestones: fish 2.4.0, fish-future Oct 17, 2016
@alphapapa
Copy link

Thanks Kurtis!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants