friendly history searching should be case insensitive #3236

Closed
krader1961 opened this Issue Jul 15, 2016 · 12 comments

Projects

None yet

5 participants

@krader1961
Member
krader1961 commented Jul 15, 2016 edited

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 milestone: fish 2.4.0, fish-future Sep 10, 2016
@krader1961
Member

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 milestone: fish-future, fish 2.4.0 Sep 18, 2016
@krader1961
Member

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
Member

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
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
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
Member

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
Member
krader1961 commented Oct 2, 2016 edited

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
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
Member

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
Member
floam commented Oct 2, 2016 edited

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

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 added a commit to krader1961/fish-shell that referenced this issue Oct 11, 2016
@krader1961 krader1961 make history searching case insentive by default
Fixes #3236
9e0dfea
@krader1961 krader1961 modified the milestone: fish 2.4.0, fish-future Oct 11, 2016
@krader1961 krader1961 added a commit to krader1961/fish-shell that referenced this issue Oct 15, 2016
@krader1961 krader1961 make history searching case insensitive by default
Fixes #3236
8888a8e
@krader1961 krader1961 added a commit to krader1961/fish-shell that referenced this issue Oct 15, 2016
@krader1961 krader1961 make history searching case insensitive by default
Fixes #3236
b7c2361
@krader1961 krader1961 added a commit to krader1961/fish-shell that referenced this issue Oct 16, 2016
@krader1961 krader1961 make history searching case insensitive by default
Fixes #3236
73575b8
@krader1961 krader1961 added a commit to krader1961/fish-shell that referenced this issue Oct 17, 2016
@krader1961 krader1961 make history searching case insensitive by default
Fixes #3236
270e9aa
@krader1961 krader1961 added a commit to krader1961/fish-shell that referenced this issue Oct 17, 2016
@krader1961 krader1961 make history searching case insensitive by default
Fixes #3236
f490b56
@krader1961 krader1961 closed this in #3460 Oct 17, 2016
@zanchey zanchey modified the milestone: fish 2.4.0, fish-future Oct 17, 2016
@alphapapa

Thanks Kurtis!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment