Coder Social home page Coder Social logo

Comments (8)

alamb3142 avatar alamb3142 commented on May 15, 2024 1

@notAxion the PR that resolves this treats dotfiles and hidden files as the same thing, because before that there was no way to hide hidden files at all & that seemed like sensible default behaviour (it's how the -a flag is "supposed" to work in my mind anyway)

Unless someone has built on this since I last looked at it I think what you're asking for requires a feature request.

from eza.

cafkafk avatar cafkafk commented on May 15, 2024

I may take a look into this at the weekend if I get the chance & no one has any complaints with this change.

That would be cool to see, I'm assuming this makes sense, but if people disagree they should feel free to voice concerns in this issue.

from eza.

alamb3142 avatar alamb3142 commented on May 15, 2024

Little bit more complicated than I'd imagined. The actual dot filter happens in the Iterator impl on Files, before the File is created. main.rs line 236 inside of print_dirs is the first time we unwrap the Result<File> so I opted to just skip pushing into children but I don't know if I'm a fan of this approach.
image

I could maybe move the error checking into these methods so Item = Result<File ...> becomes Item = File & next_visible_file can filter on attributes().hidden during the dot file check
image

for reference next_visible_file is where it feels like the hidden file check 'belongs'
image

I'll give the Iterator refactoring a go tomorrow and get a PR up to get some eyes on it

from eza.

alamb3142 avatar alamb3142 commented on May 15, 2024

Or this could work, rather than return Some(File::from_args(...)) match on the result of from_args & skip the Windows hidden files or wrap it back up in the Option<Result<>> for the calling code to handle
image

from eza.

PThorpe92 avatar PThorpe92 commented on May 15, 2024

I have been playing with this myself for the last half hour. I do agree that this seems like the most idiomatic place for this check...

How does that perform? I tried various other options but never that exact one

from eza.

alamb3142 avatar alamb3142 commented on May 15, 2024

Default behaviour with eza -l (my alias is just ls -> eza.exe)
image

It does hide symlinks which differs from default ls behaviour, but in my experience symlinks aren't as important or widely used in Windows so I think I prefer this (they're also hidden in the file system by default). It does a bit better better than PowerShell's Get-ChildItem which hides hidden files and symlinks but not dot files.

Running with -a or -A gives the following:
image

Symlinks + Windows hidden files & folders now appear (as well as dot files).

So it doesn't behave exactly the same way as a Linux ls with the symlinks, but it behaves in a way that makes more sense inside of Windows IMO

from eza.

alamb3142 avatar alamb3142 commented on May 15, 2024

I was wrong, it doesn't hide symlinks, it just hides Window's "file junctions" because these are marked as hidden by the system

Anyway the PR is up #225, I opted to put the whole match in the Windows block so the non-windows behaviour is hopefully a bit clearer.

from eza.

notAxion avatar notAxion commented on May 15, 2024

@cafkafk sorry for the ping
but I don't understand how can I actually get it to show only the dotfiles and not the hidden and symlinks ?

from eza.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.