Be more lax about paths

Have a suggestion for "Everything"? Please post it here.
Post Reply
mailnew4ster
Posts: 5
Joined: Sat Jun 19, 2021 6:31 pm

Be more lax about paths

Post by mailnew4ster »

Hi,

I love Everything and use it everyday. I also love the puns it brings, such as "Install Everything" and "About Everything". Thanks for this nifty tool!

A thing I encountered many times, enough times to register and fill this suggestion, is related to paths.

Say I have the following content in the clipboard:

Code: Select all

C:\Program Files\Internet Explorer\
I can paste it in Everything, surround it with quotes, and I get a beautiful list of files and subfolders in this folder.

But let's say I was working with WSL or Git Bash, and I copied the following content:

Code: Select all

C:/Program Files/Internet Explorer/
The magic stops working, even though slashes are understood by many parts of Windows, e.g. you can use the path in cmd or in the Run dialog.

Another example: I read C code, and copy the following path:

Code: Select all

C:\\Program Files\\Internet Explorer\\
Again, no luck. Even though I as a human totally understand what was meant, I need to go back and manually remove the extra backslashes.

My suggestion: Make Everything more flexible to recognize the above, and maybe other patterns. For a start, I believe it would be enough to normalize the input like this (JavaScript just for the idea):

Code: Select all

input.replace(/\/|\\{2,}/g, '\\')
Thank you for Everything! (pun intended)
mailnew4ster
Posts: 5
Joined: Sat Jun 19, 2021 6:31 pm

Re: Be more lax about paths

Post by mailnew4ster »

I found the "Replace forward slashes with backslashes" option, which solves the slash matches. I see no reason not to enable it by default, since it's understood almost universally by Windows, and I see no other meaning or confusion that it can cause.

The double backslashes suggestion still holds. Perhaps there's already an option for it as well, but I didn't find one.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Be more lax about paths

Post by NotNull »

mailnew4ster wrote: Sat Jun 19, 2021 7:27 pm I found the "Replace forward slashes with backslashes" option
I was just typing that when I saw your follow-up post :)
mailnew4ster wrote: Sat Jun 19, 2021 7:27 pm I see no reason to enable it by default, since it's understood almost universally by Windows, and I see no other meaning or confusion that it can cause.
The search bar can also used for search commands to execute commands or change a setting.
This can gve unexpected results. For example when you want to search for a file- or foldername that starts with "debug" and you search for /debug and press ENTER ...

I guess that is at least one reason why that setting is not enabled by default.
(workaround would be to start your /debug search with a <space> ; then it will no longer be seen asa command)


C:\\Program Files\\Internet Explorer\\
Good idea!
Might give issues with UNC-paths and Win32 namespaces, like:

Code: Select all

\\server\share
\\?\c:\folder\file.txt
mailnew4ster
Posts: 5
Joined: Sat Jun 19, 2021 6:31 pm

Re: Be more lax about paths

Post by mailnew4ster »

NotNull wrote: Sat Jun 19, 2021 7:48 pm This can gve unexpected results. For example when you want to search for a file- or foldername that starts with "debug" and you search for /debug and press ENTER ...
I don't see it as a problem, since it's very specific: It has to start with a slash, which is rare enough for a path, and one has to press enter (accidentally? why would one do so otherwise?), making this scenario very unlikely. It can also happen now, just that before pressing enter, the user won't see the desired result :)

You can also show no results in this specific case of a string starting with a slash, or showing a hint that pressing enter will execute something. I think it's rare enough that it doesn't matter.
NotNull wrote: Sat Jun 19, 2021 7:48 pm Good idea!
Might give issues with UNC-paths and Win32 namespaces, like:

Code: Select all

\\server\share
\\?\c:\folder\file.txt
Yeah, maybe add a special rule that if a token starts with \\<UNC>, it is a valid UNC prefix, and if there are no other double backslashes, match \\ specifically.
So that will be:

Code: Select all

C:\\Program Files\\Internet Explorer\\ # matches C:\Program Files\Internet Explorer\
C:\\ # matches "C:\"
\\Program Files\\Internet Explorer\\ # matches "\Program Files\Internet Explorer\", more than one \\
\\Program Files # matches "\Program Files" since "\\Program Files" is not a valid UNC
\\server\share # special case, matches \\server\share, not \server\share
\\server\\share # matches both \server\share (more than one \\) and \\server\share
\\?\c: doesn't work for me, should it?
Are UNC paths indexed by default at all?
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Be more lax about paths

Post by NotNull »

mailnew4ster wrote: Sat Jun 19, 2021 8:46 pm I don't see it as a problem, since it's very specific: It has to start with a slash, which is rare enough for a path, and one has to press enter (accidentally? why would one do so otherwise?), making this scenario very unlikely. It can also happen now, just that before pressing enter, the user won't see the desired result
Maybe it is an unlikely scenario for you, but I use it all the time, like "\etc hos" to quickly get to "C:\Windows\System32\drivers\etc\hosts".
No doubt there are people that type "/etc hos" to get the same.

Pressing ENTER is quite common too. That is a way to add your search query to the search history (just typing a search will not add it to the history) and go the the result list.


mailnew4ster wrote: Sat Jun 19, 2021 8:46 pm \\?\c: doesn't work for me, should it?
Typically not, but in Everything you can also index \\?\c: instead of c:
Long time ago I did some tests with that to see if using the win32 namespace would help with long paths ( > 259), but ran into a lot of limitations (Windows, not Everything)
So, not very practical :)
mailnew4ster wrote: Sat Jun 19, 2021 8:46 pm Are UNC paths indexed by default at all?
No, you have to add them manually through Menu:Tools > Options > Indexes > Folders
Most people will add the matching drive mapping there (if available), but it can also be useful when using the ETP Server (with path remapping on the ETP client).
mailnew4ster
Posts: 5
Joined: Sat Jun 19, 2021 6:31 pm

Re: Be more lax about paths

Post by mailnew4ster »

Well, it's up to you which cases to consider and which defaults to choose. All I need to be happy now is an option to treat multiple backslashes as one, either opt-in or opt-out. If you're feeling conservative, adding such an option and making it off by default, like the one with slashes, will work for me!
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Be more lax about paths

Post by NotNull »

That is a misunderstanding. I am not the developer of Everything ( @void is), I am just a user, just like you.

So I can not implement suggestions, only suggest alternatives that are possible with the current state of Everything, as well as give some thoughts on posted suggestions.

It is also very well possible that I overlooked some already existing feature that does exactly what you want ...
mailnew4ster
Posts: 5
Joined: Sat Jun 19, 2021 6:31 pm

Re: Be more lax about paths

Post by mailnew4ster »

OK, I thought you're a part of the dev team, since you look like an admin here (red colored name).
Post Reply