files icon indicating copy to clipboard operation
files copied to clipboard

Pathbar completion should be case sensitive

Open jeremypw opened this issue 4 years ago • 8 comments

What Happened?

When typing a path into the pathbar, I typed a directory name with an upper case letter - it was completed automatically even though the actual directory name had a lower case letter. Pressing enter then unexpectedly produced the "Directory not found" view.

Steps to Reproduce

  1. Type a path to a folder starting with a lower case letter
  2. Type the first letter of the folder in uppercase (suggested completion should appear)
  3. Press TAB to accept the suggested completion
  4. Press Enter
  5. See the "Directory not found" view

Expected Behavior

No suggested completion should appear when the incorrect case is typed (all suggested completions should actually exist).

OS Version

6.x (Odin)

Software Version

Compiled from git

Log Output

No response

Hardware Info

No response

jeremypw avatar Jan 26 '22 18:01 jeremypw

I agree that whatever's suggested by the app should be a real folder in the system. But if I may suggest an alternate solution, it would probably be even nicer to fix the capitalization of folders entered in the path bar. This is similar to how fish works by default, or how bash works with case sensitivity disabled. For example, if you type ~/docu it would suggest and correct to ~/Documents. It would be more effort to implement, but significantly more forgiving.

I see this as working by correcting the last element in the path. So once you type a / it would fix the capitalization there, but whatever "word" you're currently writing would be corrected.

mcclurgm avatar Jan 28 '22 15:01 mcclurgm

@mcclurgm Yes, probably preferable but quite tricky to implement. If you have two folders Documents and docker say, and type doc it would have to show completion docker - continuing to type docu would then have to autocorrect the completion to Documents.

jeremypw avatar Jan 28 '22 16:01 jeremypw

That's essentially what we already do if you type a lower case path to a capitalized directory. For example, I have two directories in my Documents folder, linux-config and Lisp. If I type lis it already corrects to Lisp, just not the other way round (Lin does not get corrected to linux-config, which is what you're reporting here). I would have to look at the code, but it seems like we already would have most of the plumbing in place to implement the direction from upper to lower case as well?

If it would be much more difficult, I'll break my suggestion into a new issue, so that we have a failing behavior here (suggesting nonexistent folders) and a preferred but more ambitious behavior on the wishlist separately.

mcclurgm avatar Jan 28 '22 17:01 mcclurgm

If you are happy to have a go at fixing this then please go ahead :smile:. It may be easier than I thought.

jeremypw avatar Jan 28 '22 18:01 jeremypw

Is this related to this weird behavior?

https://user-images.githubusercontent.com/15933604/175820322-0c70aab6-0d97-493c-96e2-6b4d21475555.mp4

This happens to me every now and again with different paths. I'll start typing, all lower case, and it will capitalize the first letter and jump my cursor back to the beginning.

Note, this is what is in /usr/share/icons for me at the moment: Adwaita default elementary elementary.tar.gz gnome hicolor HighContrast locolor mozc ubuntu-mono-dark ubuntu-mono-light

joshuamars avatar Jun 26 '22 15:06 joshuamars

... but only when starting from my home directory?

joshuamars avatar Jun 26 '22 15:06 joshuamars

@joshuamars You may like to try out #2059 to see whether it fixes you issue.

jeremypw avatar Jun 27 '22 09:06 jeremypw

@joshuamars You may like to try out #2059 to see whether it fixes you issue.

Works for me, I think.

joshuamars avatar Jul 03 '22 00:07 joshuamars