gardebring / PowerColorLS

PowerShell script to display a colorized directory and file listing with icons
MIT License
61 stars 3 forks source link

Add an (optional) flag to disable icons #3

Closed rashil2000 closed 3 years ago

rashil2000 commented 3 years ago

Hi!

It's so nice that PowerColorLS provides so many flags for output. Is it possible to have a flag to display the items with colors but without icons? Some terminals don't have icon support and I currently use https://github.com/JRJurman/PowerLS to have unix-like ls there.

It'd be great if I just install one module instead of two.

Thanks!

gardebring commented 3 years ago

Hi @rashil2000 You will be glad to hear that a new version of PowerColorLS was just released that adds the ability you requested. :)

rashil2000 commented 3 years ago

And here I thought this was no longer maintained (as is the case with most PowerShell modules sadly).

Sweet update! Thanks for the addition.

I have two issues to report though. One is the color of icons. Since PowerColorLS uses Terminal-Icons as a dependency, it should out the same colors as given by Terminal-Icons, right? Or is the colorscheme different? Some of the colors don't match and this causes trouble on Light themed backgrounds :(

See the pictures for reference. I think the difference is only in the default color (not for specific hard-coded folder colors).

image

image

The other one is about directory sizes. Since it's not related to icons/colors, I'll open a separate issue for that #5

gardebring commented 3 years ago

Hi again! PowerColorLS uses the default devblackops theme from Terminal-Icons. This is hard coded: https://github.com/gardebring/PowerColorLS/blob/main/src/Init/Import-Dependencies.ps1#L2 Could you provide me with an alternate theme for light backgrounds?

rashil2000 commented 3 years ago

@gardebring The screenshots provided above compare the default Terminal-Icons theme with PowerColorLS colors. So, in my opinion, the module dependency is getting loaded correctly. However, the difference arises while rendering the default color (i.e. files that do not have any specific color associated with them in the devblackops theme). For Terminal-Icons, the default fallback color is white (which gets converted to black in my Windows Terminal theme when I use Light mode), but the default fallback color for PowerColorLS seems to be yellow (which somehow doesn't convert to a darker shade when using a light mode).

Ideally, PowerColorLS should default to white, just like Terminal-Icons does, but something seems to be off, and I can't figure out what.

gardebring commented 3 years ago

@rashil2000 : The default colour for files is in fact rendered as white (well almost, EEEEEE rather than FFFFFF) https://github.com/gardebring/PowerColorLS/blob/main/src/Private/Get-Color.ps1#L89 However, directories are by default rendered as yellow (EEEE8B). https://github.com/gardebring/PowerColorLS/blob/main/src/Private/Get-Color.ps1#L65 So if you add a conversion of EEEE8B to black in your Windows Terminal Theme, it should look nice.

rashil2000 commented 3 years ago

My Windows Terminal config file looks like this:

    "schemes": [
        {
            "name": "Bluloco Light",
            "black": "#777777",
            "red": "#c90e42",
            "green": "#21883a",
            "yellow": "#d54d17",
            "blue": "#1e44dd",
            "purple": "#6d1bed",
            "cyan": "#1f4d7a",
            "white": "#000000",
            "brightBlack": "#999999",
            "brightRed": "#fc4a6d",
            "brightGreen": "#34b354",
            "brightYellow": "#b89427",
            "brightBlue": "#1085d9",
            "brightPurple": "#c00db3",
            "brightCyan": "#5b80ad",
            "brightWhite": "#1d1d22",
            "background": "#ffffff",
            "foreground": "#2a2c33"
        },
        {
            "name": "Bluloco Dark",
            "black": "#4a505d",
            "red": "#f81141",
            "green": "#23974a",
            "yellow": "#fd7e57",
            "blue": "#285bff",
            "purple": "#8c62fd",
            "cyan": "#366f9a",
            "white": "#a1b8df",
            "brightBlack": "#61697a",
            "brightRed": "#fc4a6d",
            "brightGreen": "#37bd58",
            "brightYellow": "#f6be48",
            "brightBlue": "#199ffd",
            "brightPurple": "#fc58f6",
            "brightCyan": "#50acae",
            "brightWhite": "#ffffff",
            "background": "#1e2127",
            "foreground": "#abb2bf"
        }
    ]

How/where do I add a conversion? PowerColorLS seems to be overriding these...

Also, for files/directories that don't have a color defined, Terminal-Icons just prints them as normal text. I think this is why Windows Terminal is able to convert the text color.

rashil2000 commented 3 years ago

For the time being, I just changed both EEEEEE and EEEE8B to 888888 (grey), which is visible on both black and white :)

gardebring commented 3 years ago

For the time being, I just changed both EEEEEE and EEEE8B to 888888 (grey), which is visible on both black and white :)

Great. Should I close this?

rashil2000 commented 3 years ago

Yes sure! I'll do it.