sublime_text
sublime_text copied to clipboard
"Unable to open" when performing Find in Files on folder path with comma
When using Find in Files, if I supply a folder path that contains a comma, like this:
Where: /usr/lib/haxe/lib/munit/2,1,0/massive/munit
The result of the search is
Searching 1 file for "the" (regex, case sensitive)
Unable to open /usr/lib/haxe/lib/munit/2
0 matches across 0 files
Commas are legal characters is OSX paths. I don't personally use them, but Haxelib does, and this is what I get when trying to search my installed Haxe libraries. I'm running Yosemite OSX.
Same issue (and with haxe as well) on windows 7.
I add my two cents: on Windows 7 I tried to use quotes around the path, but the result is that ST finds the string in the open tabs instead that in the filesystem files. Thanks,
Mario.
Just wanted to highlight same issue was raised earlier, but not sure which one is being tracked for future enhancement. https://forum.sublimetext.com/t/escape-comma-in-file-path-for-sublime-find-in-files/13540
Confirming it also happens in Linux. This potentially happens with any folder mounted with GVFS as the folder they're mounted to contains a comma if a username is present. e.g.
/run/user/1000/gvfs/sftp:sftp:host=host-domain.com.au,user=username/
I've tried several file managers under Ubuntu Linux including Nautilus, Nemo and Thunar.
This location works fine in the folders sidebar, including the new git status indicators.
However the resulting output for a "find in folder" search is
Searching 1 file for "test"
/run/user/1000/gvfs/sftp:host=host-domain.com.au:
ERROR: Unable to open file
0 matches
Hello from 2020. All ok. bug is steel hear. "Find and replace" is completely useless if the path contains a comma.
2021 here. Still an issue. In a corporate world that uses OneDrive, this is a problem.
Seems to work, if the parent folder is added to "Where"
But it does indeed not work, if the comma containing folder is used:
Quoting the Where path doesn't work as well
- ST 4113, Windows 10 21H1
Basically comma's can't work as those are used as delimiters to add filter specifications. As Linux/MacOS allow nearly any character in path any character used as delimiter would cause such a problem.
But I'd at least expect quoted paths to work, especially as it was stated to work in https://github.com/sublimehq/sublime_text/issues/4799#issuecomment-909823648
It's not great, but for those wanting something as a workaround, you can use relative pathing (eg: ./
) in the Where:
field to prevent referencing the part of the path that contains a comma
+1 for this issue ... for Company based One Drive's where there is a comma in the name, the "find in folder" is completely useless.
- ./ doesnt seem to work either ... I end up with 0 files searched
- likewise with ""
I will assume this is related to the multiple folder patterning as that has a comma based delimeter
Build 4149 adds the ability to quote paths in the "Where" field. The quoting follows platform standards. Paths are automatically quoted if added through the UI.