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

ls does not support option '--indicator-style' on FreeBSD #234

Closed bpn19 closed 1 year ago

bpn19 commented 1 year ago

Describe the bug Directory previews fail with ls diagnostic while using shotgun

To Reproduce Steps to reproduce the behavior:

  1. Start CliFM
  2. Open shotgun using <tab> and select any directory
  3. See ls: unrecognized option '--indicator-style=none'

Expected behavior The auto-generated preview.clifm file should not contain the option when compiling for FreeBSD.

Desktop (please complete the following information):

Additional context Obviously an easy fix for me to just remove the option from the config file with view edit, but I consider it non-ideal behavior for basic directory previews to be broken by default on FreeBSD.

I confirmed that the problem occurs with both the ports based pkg install clifm and my own git clone version. Could trip up new users. Interested in your thoughts, I think a simple #ifdef etc would work?

leo-arch commented 1 year ago

Hi @bpn19, and thanks for your thoughts. Absolutely agreed. Now:

  1. An #ifdef could be used for the auto-generated config file (preview.clifm). No problem.
  2. The thing is that the default installation imports this file from the data directory (usually /usr/local/share/clifm/preview.clifm), so that fixing this file is the main goal.

The ideal solution would be to first check for gls (which does support --indicator-style) and then, if not there, for ls (removing this option if running on BSD). Maybe we could just avoid importing the file on BSD, jumping directly to the auto-generated file.

leo-arch commented 1 year ago

Should be solved now.

How to test

  1. git clone and make the latest version (1.12.15).
  2. Remove your preview.clifm file (from ~/.config/clifm/profiles/default/).
  3. Restart clifm: the file should be created anew using now the internally auto-generated file (instead of the one in the data dir).
bpn19 commented 1 year ago

Hello @leo-arch, you're completely correct about gls, good point.

Thanks for the quick turnaround, I can confirm that this is now fixed.