leo-arch / clifm

The shell-like, command line terminal file manager: simple, fast, extensible, and lightweight as hell.
https://github.com/leo-arch/clifm/wiki
GNU General Public License v2.0
1.33k stars 40 forks source link

ow doesn't work on symlinks #296

Closed muellerto closed 2 months ago

muellerto commented 3 months ago

Describe the bug ow on a symlink doesn't bring a list of applications usable for this file type. The list remains empty.

To Reproduce Steps to reproduce the behavior:

  1. have a symlink on a file so that the symlink looks exactly like the file itself (same extension)
  2. execute ow on that symlink

Expected behavior I would expect that clifm acts on a symlink like on any other file.

Screenshots 1

ow on number 11 brings nothing. ow on number 12 which is just a copy of the file behind number 11 works as expected. clifm makes a difference which is not needed.

Desktop (please complete the following information):

leo-arch commented 3 months ago

Hi @muellerto, and thanks for reporting. It should be solved now.

muellerto commented 2 months ago

Not sure. On Linux it seemed somehow to work. On Windows it looks like that: 1

Interesting are here several things:

I don't see any system behind. Why don't all the links work like number 8?

leo-arch commented 2 months ago

Could you run mm info on those files refusing to work with ow? Does it inform some opening app? And, what is the informed MIME type?

Testing on my Windows box; cannot reproduce the issue yet.

muellerto commented 2 months ago

It's as follows: 1

This explains the difference between number 8 (ow lists applications) and number 10 (ow lists nothing).

A question is why .js files seem to have no associations at all. The according rule is:

#-----------------------------
# Text
#-----------------------------

X:^text/rtf$=libreoffice;soffice;ooffice
X:(^text/.*|application/json|inode/x-empty)=$EDITOR;$VISUAL;kak;dte;vim;vi;nvim;gvim;micro;mg;emacs;notepad;ed;nano;mili;leafpad;mousepad;featherpad;nedit;kate;gedit;pluma;io.elementary.code;liri-text;xed;atom;nota;gobby;kwrite;xedit
!X:(^text/.*|application/json|inode/x-empty)=$EDITOR;$VISUAL;kak;dte;vim;vi;nvim;micro;mg;emacs;notepad;ed;nano

Ahhh, I read elsewhere that application/javascript is an own mime type, so .js files are not matched by text/.*. OK, I can add this in these lines. With that change it looks as it should:

2

Thanks a lot for reading :)

leo-arch commented 2 months ago

Great!

I guess I'll modify the default mimelist.clifm file to include application/javascript as plain text:

X:(^text/.*|application/(json|javascript)|inode/x-empty)=...
!X:(^text/.*|application/(json|javascript)|inode/x-empty)=...