lsd
lsd copied to clipboard
Stop lsd on windows from showing every regular file as green
- os: Windows 11
lsd --version: lsd 0.22.0echo $TERM: N/Aecho $LS_COLORS: N/A
Windows NTFS doesnt have POSIX file permissions, so they need to be emulated. This results in all files being marked as executable, which is necessary but annoying, since every regular file is shown in green. Is there a way to make executable files white?
Can one not create a new theme and select unique colours based on the file extension?
Note that the NTUSER.DAT* files are supposed to be hidden
ll is an alias for lsd -l
You can change the color of items by using LS_COLORS, but the problem here is that the executable flag overrides the colors set based on extension.
You can change the color of items by using LS_COLORS, but the problem here is that the executable flag overrides the colors set based on extension.
Is lsd ignoring the hidden flag of files by default?
What do you mean by hidden flag?
In Windows you can set a file to be Hidden.
Oh, I was not aware of it. I don't think we are handling that as of now.
@meain Genuinely reconsider please. Ignoring hidden files/folders would make a world of difference for Windows or WSL users. 90% of apps/programs on Windows don't use '.' or '_' for hidden files/folders like they would on *Nix, and instead rely on Windows default hidden flag. I know it's a hassle, but such is life for supporting Windows.
If exa implements this before lsd, it'd be a big enough deal for me to switch despite needing to self-compile exa.
I don't use Windows and don't have enough context to take a decision on this. How is it done in other programs like ripgrep and fd? Do they take into account hidden flag in Windows? @TeamTamoad since you are a Windows user, let me know if you have any thought around it.
Actually, I'm a Linux user. I just happened to have a Windows laptop to test on some issue.
I think implementing these kind of feature is not a bad thing because it makes the user happy 😃. I've looked into ripgrep and fd, they've implemented hidden files on Windows correctly (see this and this)
However, the problem is that we need someone to implement this. Since I've had a full-time job 3 months ago, I have much less time to contribute to this project.
Thanks @TeamTamoad for linking to rg and fd issues. I think it makes sense to have lsd respect hidden files in windows when not using -a or -A. That said, I thin this is different from the original issue which was about file permissions. I'll create a separate issue (https://github.com/Peltoche/lsd/issues/752) for respecting hidden flag in windows.
PS: No pressure on your to pick it up btw. Just thought I would get your thoughts on this as I have seen you comment on Windows related issues. :D.
While we are on the topic, my understanding is that there is no such thing as "executable" flag on windows, or is there a flag we can query which lsd is not already doing? If there is no such thing as a executable, although we can override the color of executable using LS_COLORS, I don't might changing the it so that lsd does not treat every file as executable.
windows does not have an executable flag, but we could make files with an executable extention like .exe, .bat, .cmd, .ps1, etc show as green.
I think in that case the quickest option would be to just use the option suggested by https://github.com/Peltoche/lsd/issues/712#issuecomment-1232868513 .
Oh by the way, windows has 2 different kinds of hidden files. There's normal hidden files and operating system protected files. Those NTUSER.dat files are the second kind. The user almost never has to interact with OS protected files, I've never done so once in my 10 years or so of using Windows. I would suggest making a dedicated command line flag to show OS protected files, and normal hidden files can be shown with just -a or -A.
Oh by the way, windows has 2 different kinds of hidden files. There's normal hidden files and operating system protected files. Those NTUSER.dat files are the second kind. The user almost never has to interact with OS protected files, I've never done so once in my 10 years or so of using Windows. I would suggest making a dedicated command line flag to show OS protected files, and normal hidden files can be shown with just -a or -A.
You are right. I like your suggestion.