sublime_text icon indicating copy to clipboard operation
sublime_text copied to clipboard

"Unable to open" when performing Find in Files on folder path with comma

Open scriptorum opened this issue 9 years ago • 9 comments

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.

scriptorum avatar Mar 11 '15 20:03 scriptorum

Same issue (and with haxe as well) on windows 7.

Misiur avatar Jul 18 '16 17:07 Misiur

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.

omarita avatar Oct 18 '17 09:10 omarita

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

kenjim avatar Oct 23 '17 18:10 kenjim

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

fluffylynx avatar Mar 18 '19 03:03 fluffylynx

Hello from 2020. All ok. bug is steel hear. "Find and replace" is completely useless if the path contains a comma.

demimurych avatar Sep 05 '20 03:09 demimurych

2021 here. Still an issue. In a corporate world that uses OneDrive, this is a problem.

jgandy avatar Sep 01 '21 19:09 jgandy

Seems to work, if the parent folder is added to "Where"

grafik

grafik

But it does indeed not work, if the comma containing folder is used:

grafik

grafik

Quoting the Where path doesn't work as well

grafik

grafik

grafik


  • ST 4113, Windows 10 21H1

deathaxe avatar Sep 01 '21 19:09 deathaxe

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

deathaxe avatar Sep 01 '21 19:09 deathaxe

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 image

techsun avatar Jul 27 '22 13:07 techsun

+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

kiptonui avatar Dec 15 '22 15:12 kiptonui

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.

BenjaminSchaaf avatar May 04 '23 01:05 BenjaminSchaaf