lsd
lsd copied to clipboard
Treat items starting with '_' the same as files starting with '.' and ignore them.
A relatively uncommon but still popular method of marking files to be ignored is beginning them with '_' instead of '.'.
VIM does this, with the _viminfo file, less does this for the _lesshist file, etc. It's pretty uncommon, but it's also really uncommon to begin files/directories with '_' in the first place.
I'd like to see this prefix added alongside '.' and ignored like it is in exa. It's the only thing exa does differently that I really want in lsd.
Example:

I don't think that is something we would want in lsd as this would make us deviate from what gnu ls does. Do you have some links pointing to docs in exa where they mention hiding filenames starting with _?
I don't really feel like digging through docs. Here's the difference in action though:

maybe we can did this for windows, seems like a windows feature/common used case
https://stackoverflow.com/a/63516223/4242336
That is pretty interesting. I guess we can consider hiding _ by default.
Any updates to this issue that I might have missed? It's been quite a while and this issue was never revisited.
/help /good-first-issue /milestone v1.1.0
@zwpaper: This request has been marked as suitable for new contributors.
Please ensure the request meets the requirements listed here.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.
In response to this:
/help /good-first-issue /milestone v1.1.0
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.
we could hide _ prefixed file ONLY in windows by default, and add a flag to control this.
ref: https://man7.org/linux/man-pages/man1/ls.1.html
--hide=PATTERN
do not list implied entries matching shell PATTERN
(overridden by -a or -A)
I was looking at working out how to implement this as a first issue. The easiest way would surely just be to have the following in the config file by default on Windows:
ignore-globs:
- _*
# - .git
However, ignored globs given here or by using the -I flag currently can't be overidden by using the -a flag. Shouldn't -a take precedence over -I?
Furthermore, this of course only works if a config file is present with that option, and at least for me, no config file was generated upon installation and I had to manually create it myself. Isn't it desirable to automatically create the config file when lsd when it is run for the first time? If this was the case, that option could simply be included in the config file by default on Windows and not otherwise.
As a Windows user, I'd be very surprised if this behaviour were enabled by default. It would seem very weird to me if, e.g. __init__.py files were being hidden. I get the vim use case and I understand making it configurable but I feel it should be something users choose to opt-in to as it's a niche non-standard thing that most people won't even be aware of.
This seems like a really bad idea to implement automatically, I don't know any other program that does this on Windows, other than VIM which isn't exactly a Windows native program. Preferably just leave it to the users to use "ignore-globs"
Yeah I don't particularly care whether it's automatic or not, I just think the feature should be there in some capacity, especially if you want feature parity with exa/eza or whatever.
So in other words, you suggest using "ignore-globs" for ignoring paths, but when doing -a (which implies show everything) the ignores should not be used. Is that right? @Terraphice ? I think this makes sense, especially since we already have the middle ground of using -A which shows "almost everything" so that should ignore what the user wanted to ignore, but -a wouldn't.
If @zwpaper / @meain support this, I'll happily write a PR for this
yes, IMHO just like the GNU ls support --ignore and --hide, we should also impl that and leave the choice to users, they could add any globs to the configuration file if they like.
and we are not setting any default values even in Windows.
please notice,
--ignorewill NOT be overwritten by-aor-A--hidewill be overwritten by both-aand-A
thanks so much if anyone could help @ofersadan85