Skip to content
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

"open folder" does not select the attached file(s) of the entry #8849

Closed
ilippert opened this issue May 25, 2022 · 5 comments · Fixed by #8853
Closed

"open folder" does not select the attached file(s) of the entry #8849

ilippert opened this issue May 25, 2022 · 5 comments · Fixed by #8853

Comments

@ilippert
Copy link
Contributor

JabRef 5.7--2022-05-23--117bb1c
Linux 5.17.9-300.fc36.x86_64 amd64
Java 18.0.1
JavaFX unknown

the folder opens now.

However, when opening, it does not select the file of the entry. That, however, would be very helpful, given, at least in my case, users might have many pdfs etc linked to entries.

Originally posted by @ilippert in #8093 (comment)

@ilippert ilippert changed the title JabRef 5.7--2022-05-23--117bb1c "open folder" does not select the attached file(s) of the entry May 25, 2022
@ThiloteE
Copy link
Member

related issue with hint to solution:

cboxdoerfer/fsearch#322

When I right click a searched file and click "Open Folder" (Ctrl+Return) , it does not not select the opened file in the file explorer (in my case nemo).

The reason why this doesn't work by default yet is because I haven't found a way to make it work on all file managers.

What i want is , when I right click on /home/ismail/Documents/a.adoc and click "Open Folder" , it should act like I used the command nemo /home/ismail/Documents/a.adoc so that the result looks like

This command only works when you select a file. If a.doc is a folder then nemo will just open that folder instead of selecting it. That's why for example Nautilus has the --select flag, which explicitly selects the last element, regardless whether it's a file or folder.

FSearch has an undocumented setting which allows you to make use of that and configure the folder open command. So if Nemo has the --select flag, you can simply add this to the end of your FSearch config file:

[Applications]
folder_open_cmd=nemo --select {path_full}

and if it doesn't and you don't mind that it will open folders instead of selecting them:

[Applications]
folder_open_cmd=nemo {path_full}

@ThiloteE
Copy link
Member

This issue is very much related to and JabRefs behaviour may change depending on the solution for #8679

@ThiloteE
Copy link
Member

commands for nautilus, which is the gnome file manager:
https://gitlab.gnome.org/GNOME/nautilus/-/blob/master/docs/nautilus.1

specifically:

.TP
.BR -w ", " --new-window
Always open a new window for browsing specified URIs.

.TP
.BR -s ", " --select
Select specified URI in parent folder.

last commit that changed this: 4baf2a1

Which already implements the --select option. Not sure, why it does not work.

Maybe it has something to do with the comma as seen above? Or maybe it would be worth a try to use something like this:

cmd = "nautilus --new-window --select " + filePath.toString().replace(" ", "\\ ");

@ThiloteE
Copy link
Member

@ilippert Christoph and me tried another method that is able to open the folder and selects the file. The new method also works for Linux Mint Cinnamon (Nemo file manager), but we have not tested the other Linux distributions. Would you mind testing the PR 8853? It can be downloaded here: https://builds.jabref.org/pull/8853/merge/

@ilippert
Copy link
Contributor Author

ilippert commented Jun 1, 2022

Thank you!

now at
JabRef 5.7-PullRequest8853.96--2022-05-31--33aa338
Linux 5.17.11-300.fc36.x86_64 amd64
Java 18.0.1
JavaFX unknown

this fix works for me on Gnome, Fedora 36.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants