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

Custom config.yaml appears to be ignored if the newest sample from README.md used. #921

Closed
pi-314 opened this issue Oct 1, 2023 · 2 comments

Comments

@pi-314
Copy link

pi-314 commented Oct 1, 2023

  • os:macOS 14.0
  • lsd --version: 1.0.0
  • echo $TERM: xterm-256color
  • echo $LS_COLORS: di=1;36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43

Installed with Homebrew, lsd comes (at the time of writing) in v 1.0.0, which doesn't contain two unreleased features (--truncate-owner-*and --literal). At the same time the config sample config.yaml in README.md already provides the configuration elements for that flags. If user creates the custom configuration from this template, it looks like the config.yaml is being ignored. Tre real cause is shown in backtrace:

lsd: Configuration file ~/.config/lsd/config.yaml format error, unknown field `literal`, expected one of `classic`, `blocks`, `color`, `date`, `dereference`, `display`, `icons`, `ignore-globs`, `indicators`, `layout`, `recursion`, `size`, `permission`, `sorting`, `no-symlink`, `total-size`, `symlink-arrow`, `hyperlink`, `header` at line 140 column 1.

thread 'main' panicked at 'Provided file path is invalid', src/main.rs:117:33
stack backtrace:
   0:        0x1008d756c - __mh_execute_header
   1:        0x100834a20 - __mh_execute_header
   2:        0x1008bcef8 - __mh_execute_header
   3:        0x1008d7324 - __mh_execute_header
   4:        0x1008bd638 - __mh_execute_header
   5:        0x1008bdd54 - __mh_execute_header
   6:        0x1008d78ac - __mh_execute_header
   7:        0x1008d7820 - __mh_execute_header
   8:        0x1008bd8cc - __mh_execute_header
   9:        0x100946aa8 - __mh_execute_header
  10:        0x10094694c - __mh_execute_header
  11:        0x1007d388c - __mh_execute_header
  12:        0x100791f50 - __mh_execute_header
  13:        0x1007e8600 - __mh_execute_header

But this can be discovered only by specifying the --config-file flag explicitly. For the normal run it looks like the config file just had no effect at all.

Expected behavior

lsd should either crash if some unknown element exists in yaml config file or maybe display a warning. (However the second option would break compatibility with ls.)

Actual behavior

lsd just ignores provided config.yaml silently.

@zwpaper
Copy link
Member

zwpaper commented Oct 3, 2023

the master branch is for latest dev features, please check https://github.com/lsd-rs/lsd/tree/v1.0.0

close due to duplicated with #922

/close

@muniu-bot muniu-bot bot closed this as completed Oct 3, 2023
@muniu-bot
Copy link

muniu-bot bot commented Oct 3, 2023

@zwpaper: Closing this issue.

In response to this:

the master branch is for latest dev features, please check https://github.com/lsd-rs/lsd/tree/v1.0.0

close due to duplicated with #922

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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

No branches or pull requests

2 participants