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

The colors for directories output look super wierd since Powershell 7.3 update #18778

Open
5 tasks done
HymanZHAN opened this issue Dec 13, 2022 · 6 comments
Open
5 tasks done
Labels
Issue-Enhancement the issue is more of a feature request than a bug KeepOpen The bot will ignore these and not auto-close Needs-Triage The issue is new and needs to be triaged by a work group. WG-Interactive-Console the console experience WG-NeedsReview Needs a review by the labeled Working Group

Comments

@HymanZHAN
Copy link

HymanZHAN commented Dec 13, 2022

Prerequisites

Steps to reproduce

I like the new effort of using ANSI formatting in $PSStyle. However, I don't think the outcome is ideal. At least not in the case of FileInfo.Directory.

Expected behavior

I should see the outcome of `ls` clearly. There should be enough contrast, and texts should be easy to read.

Actual behavior

The current style of having a blue background for directories is hard to read and looks awful.

Error details

No response

Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.0
PSEdition                      Core
GitCommitId                    7.3.0
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

Current:

image

What I think was intended:

image

I am using the One Half Dark theme that comes with Windows Terminal.

@HymanZHAN HymanZHAN added the Needs-Triage The issue is new and needs to be triaged by a work group. label Dec 13, 2022
@HymanZHAN
Copy link
Author

Related issue: #18550

@HymanZHAN HymanZHAN changed the title color scheme looks super wierd since Powershell 7.3 update The colors for directories output look super wierd since Powershell 7.3 update Dec 13, 2022
@petrsapak
Copy link

I'm experiencing the same issue in Windows Terminal 1.15.3466.0, One Half Dark (other color schemes are messed the same way) color scheme and Powershell 7.3.0 & 7.3.1.
As a workaround I tried this:

  • I changed the color "Blue" to the same color as "Background" which fixed the issue, but caused some color issues when using posh-git module.
  • I installed PSColor module, which fixed the issue, making my get-childitem calls look like this:
    image

@HymanZHAN
Copy link
Author

HymanZHAN commented Dec 16, 2022

@petrsapak Thanks for your input~ Yeah, I already had my workaround in my $PROFILE, but I wish there would be an upstream fix.

As a side note, the full list of colors can be listed by $PSStyle:

image

And you may set the style for FileInfo.Directory directly:

$PSStyle.FileInfo.Directory = "`e[34m"

Hopefully, this would not cause issues on posh-git's side. (I also use posh-git, but I don't use its prompt. I am using starship instead.)

Another side note: The exactly identical issue occurred a few years ago on WSL1 using Ubuntu (18.04, I believe). Same colored background for directory listing, with low contrast and eyesore aesthetics. (It's blue foreground with a green background, IIRC🙍‍♂️) I hope this issue gets fixed soon.
That's a different issue related to the default styling of dircolors for different directory types.

@StevenBucher98 StevenBucher98 added the Issue-Enhancement the issue is more of a feature request than a bug label Dec 21, 2022
@robinmalik
Copy link

Broke retrowave for me:

image

@9Rune5
Copy link

9Rune5 commented Nov 7, 2023

  • I installed PSColor module, which fixed the issue, making my get-childitem calls look like this:

I'd like to recommend https://github.com/DHowett/DirColors instead. Especially if you're using MIcrosoft Terminal.

GitHub
DirColors is a Powershell implementation of GNU coreutils' dircolors/LS_COLORS support - GitHub - DHowett/DirColors: DirColors is a Powershell implementation of GNU coreutils' dircolors/LS_...

@reeddunkle
Copy link

reeddunkle commented Dec 8, 2023

In case it helps someone else: the color formatting can be combined with bold formatting (for example):

$PSStyle.FileInfo.Directory = "`e[96;1m"
# Foreground.BrightCyan + Bold

There are also custom RGB definitions: https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#text-formatting

Virtual terminal sequences are control character sequences that can control cursor movement, color/font mode, and other operations when written to the output stream.

@SteveL-MSFT SteveL-MSFT added KeepOpen The bot will ignore these and not auto-close WG-NeedsReview Needs a review by the labeled Working Group WG-Interactive-Console the console experience labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement the issue is more of a feature request than a bug KeepOpen The bot will ignore these and not auto-close Needs-Triage The issue is new and needs to be triaged by a work group. WG-Interactive-Console the console experience WG-NeedsReview Needs a review by the labeled Working Group
Projects
None yet
Development

No branches or pull requests

7 participants