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

Stop lsd on windows from showing every regular file as green #712

Closed
Un1q32 opened this issue Aug 7, 2022 · 15 comments · Fixed by #769
Closed

Stop lsd on windows from showing every regular file as green #712

Un1q32 opened this issue Aug 7, 2022 · 15 comments · Fixed by #769

Comments

@Un1q32
Copy link
Contributor

Un1q32 commented Aug 7, 2022

  • os: Windows 11
  • lsd --version: lsd 0.22.0
  • echo $TERM: N/A
  • echo $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?

@daniejstriata
Copy link
Contributor

daniejstriata commented Aug 31, 2022

Can one not create a new theme and select unique colours based on the file extension?
image
Note that the NTUSER.DAT* files are supposed to be hidden

image
image
ll is an alias for lsd -l

@meain
Copy link
Member

meain commented Sep 1, 2022

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.

@daniejstriata
Copy link
Contributor

daniejstriata commented Sep 1, 2022

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?

@meain
Copy link
Member

meain commented Sep 5, 2022

What do you mean by hidden flag?

@daniejstriata
Copy link
Contributor

In Windows you can set a file to be Hidden.

@meain
Copy link
Member

meain commented Sep 5, 2022

Oh, I was not aware of it. I don't think we are handling that as of now.

@Terraphice
Copy link

Terraphice commented Oct 12, 2022

@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.

@meain
Copy link
Member

meain commented Oct 12, 2022

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.

@TeamTamoad
Copy link
Contributor

TeamTamoad commented Oct 12, 2022

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.

@meain
Copy link
Member

meain commented Oct 13, 2022

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 (#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.

@meain
Copy link
Member

meain commented Oct 13, 2022

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.

@Un1q32
Copy link
Contributor Author

Un1q32 commented Oct 14, 2022

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.

@meain
Copy link
Member

meain commented Oct 14, 2022

I think in that case the quickest option would be to just use the option suggested by #712 (comment) .

@Un1q32
Copy link
Contributor Author

Un1q32 commented Oct 14, 2022

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.

@daniejstriata
Copy link
Contributor

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.

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

Successfully merging a pull request may close this issue.

5 participants