Repository: eza-community/eza (language: rust)

Issue:
feat: Windows Hidden Files Support
So I installed eza on my work laptop (which unfortunately has Windows 11 installed) because I wanted a more Linux-ey way to search for files in PowerShell. 

Something that would make eza an even better alternative to PowerShell's Get-ChildItem would be to hide Windows hidden files when `-a` isn't specified. The current behaviour only hides dot files.

I don't think this would be too hard to implement as the hidden flag is included when running `eza -l` so the information is there.
![image](https://github.com/eza-community/eza/assets/127202207/86ebbcd7-6c29-4de4-8d00-031cbc2e17ca)

I may take a look into this at the weekend if I get the chance & no one has any complaints with this change.


Discussion / hints:
> 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.

Fix patch:
diff --git a/src/fs/dir.rs b/src/fs/dir.rs
index f2d709319..9303feedb 100644
--- a/src/fs/dir.rs
+++ b/src/fs/dir.rs
@@ -129,11 +129,24 @@ impl<'dir, 'ig> Files<'dir, 'ig> {
                     }
                 }
 
-                return Some(File::from_args(path.clone(), self.dir, filename, self.deref_links)
-                                 .map_err(|e| (path.clone(), e)))
+                let file = File::from_args(
+                    path.clone(),
+                    self.dir,
+                    filename,
+                    self.deref_links
+                ).map_err(|e| (path.clone(), e));
+
+                // Windows has its own concept of hidden files, with a flag
+                // stored in the file's attributes
+                #[cfg(windows)]
+                if !self.dotfiles && file.as_ref().is_ok_and(|f| f.attributes().hidden) {
+                    continue;
+                }
+
+                return Some(file);
             }
 
-            return None
+            return None;
         }
     }
 }


Test patch: