-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When filename contains comma, extra unrelated folder opens #9
Comments
I can't assure it works on every single Linux machine due to fragmentation, but this fixed it for me: - file_browser_linux_cmd = "dbus-send --print-reply --dest=org.freedesktop.FileManager1 /org/freedesktop/FileManager1 org.freedesktop.FileManager1.ShowItems array:string:\"file:$path\" string:\"\""
+ file_browser_linux_cmd = "dirname $path | xargs -0 xdg-open" - return path_root() .. table.concat(parts, path_sep())
+ local path = path_root() .. table.concat(parts, path_sep())
+ return path:gsub('"', '\\"'):gsub("'", "\\'"):gsub(" ", "\\ ") I ditched I tested the solution in path with comma, single quote, double quote, space and bracket, all worked. |
It does not work for SMB path. It opened two windows of Gnome Files with error messages. It is an SMB path mapped by GVFS, I believe, and the format is like:
which is actually |
I could made it work. Basically, the idea is replacing
Like: |
Damn, after creating my own solution, I realised that you had posted your solution. I am not sure which of "xdg-open" or "dbus-send" is the newer standard, but your way, does it select the current file? Doesn't it only open the parent directory without selecting the current file? |
It doesn't select the file, at least on my file manager (Dolphin). It only opens directory. If you know how to make it select the file, please let me know. |
Tested on Linux, desktop environment: KDE Plasma, file manager Dolphin.
If current file has comma in its name, locatefile opens not just its folder, but also another unrelated folder, probably the system default one, in my case it's
/home/user/
, aka~/
.I guess this is a missing escaping issue. locatefile should try to escape comma in path. Currently, I believe it's causing
,
to be interpreted by command as an argument separator, thus launching two folders instead of just one.Log:
The text was updated successfully, but these errors were encountered: