lsd-rs / lsd

The next gen ls command
Apache License 2.0
13.29k stars 431 forks source link

Colouring logic and other adaptations for Windows not applied under WSL #1070

Open matterhorn103 opened 3 months ago

matterhorn103 commented 3 months ago

I can see from #712 that on Windows, lsd has been adapted so that it doesn't just colour every file on a Windows system as if it is executable.

However, when using lsd in a Linux distro via Windows Subsystem for Linux, the old behaviour is still present when browsing the "Windows side" of the file system.

In the screenshots you can see what I mean; they show two clones of the same repo, on the Linux part of the filesystem:

Screenshot 2024-06-29 145228

and on the Windows part:

Screenshot 2024-06-29 232807

I installed lsd for Windows too to check and in Powershell the colours are the correct ones for the same folder on the Windows side:

Screenshot 2024-06-29 233714

Ideally, for consistency, whatever logic is applied for the Windows version of lsd would also be applied to Windows files in WSL.

zwpaper commented 3 months ago

it's because of the permissions of files mounted by WSL, can you should them by ls -l and we can dig into it deeper.

matterhorn103 commented 3 months ago

Well yes it's because they are all marked as executable, right? But on Windows lsd knows how to cope with this -- with lsd -l each file's line starts with .a--- ? ? and each directory with d---- ? ?, whereas under WSL the permissions for the same files are given as .rwxrwxrwx and drwxrwxrwx respectively.