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

Some command line output ignores system foreground color configuration #1633

Closed
jrob opened this issue Jun 8, 2017 · 3 comments
Closed

Some command line output ignores system foreground color configuration #1633

jrob opened this issue Jun 8, 2017 · 3 comments
Milestone

Comments

@jrob
Copy link

jrob commented Jun 8, 2017

What You Are Seeing?

When running in a shell with a white background, some text is invisible.

Screenshot:

screenshot

Actual text:

$ ./build.ps1 --showdescription
Preparing to run build script...
Running build script...
Analyzing build script...
Processing build script...
Installing tools...
Installing addins...
Compiling build script...

Task                          Description
===============================================================================
Restore-NuGet-Packages

What is Expected?

The output should respect the configured foreground colors so that text is visible.

What version of Cake are you using?

Version 0.19.5+Branch.main.Sha.e4c4ad2a949637f89063dc7a90363839b740af2c

Are you running on a 32 or 64 bit system?

64

What environment are you running on? Windows? Linux? Mac?

Windows 10 with the default shell.

How Did You Get This To Happen? (Steps to Reproduce)

Current colors set for the shell

$colors = [Enum]::GetValues( [ConsoleColor] )
$max = ($colors | foreach { "$_ ".Length } | Measure-Object -Maximum).Maximum
foreach( $color in $colors ) {
    Write-Host (" {0,2} {1,$max} " -f [int]$color,$color) -NoNewline
    Write-Host "$color" -Foreground $color
}

CLI Colors

Windows powershell properties.

Powershell Properties

jeanfrancoislarente pushed a commit to Sitecore/Sitecore.Demo.Platform that referenced this issue Nov 29, 2019
Color-coded logging does not work because of issue in Cake cake-build/cake#1633
jeanfrancoislarente pushed a commit to Sitecore/Sitecore.Demo.Platform that referenced this issue Nov 29, 2019
Color-coded logging does not work because of issue in Cake (example: cake-build/cake#1633) and there is no obvious fix for it, so I've enabled "Warning/Info/Error" prefixes and removed Info/Debug entries from PS console output by default (visible when Sync.ps1 is called directly)

How it looks now on initial deploy:

![image.png](https://dev.azure.com/sitecoredst/f9b5d027-f29c-449f-826c-d7bb655b30f4/_apis/git/repositories/7a4bd0ee-c068-422b-8891-a5085900757d/pullRequests/1755/attachments/image.png)

Related work items: #3794
@mcraiha
Copy link

mcraiha commented Jan 22, 2020

hardtoread
With macOS default foreground color is hard to read when terminal is running with white background color

@augustoproiete
Copy link
Member

augustoproiete commented Feb 17, 2021

@jrob, this has been fixed with PR #3094 and will be released with Cake v1.1.0

@mcraiha The current color palette of Cake doesn't work well with light backgrounds. We have an issue open to support custom ConsolePalette/ANSI colors which eventually would provide an alternative for the issue you pointed out.

One workaround would be to use the Cake.LightModeConsole.Module, which replaces the default console palette with one suitable for light background colors.

Another alternative which will be available in the next release of Cake (v1.1.0 as of this writing) is the ability to disable colors with an environment variable called NO_COLOR which would be a workaround for devs using light backgrounds until #2976 or something better comes along.

@cake-build-bot
Copy link

🎉 This issue has been resolved in version v1.1.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

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

No branches or pull requests

4 participants