choco icon indicating copy to clipboard operation
choco copied to clipboard

Support ANSI color output.

Open rkitover opened this issue 4 years ago • 2 comments

It seems that Chocolatey uses Windows console colors for output.

For a command such as:

ssh winserver choco install -y somepackage

there are no colors. While this is a deficiency in OpenSSH for Windows, it would be nice if the Chocolatey logging system was able to output normal ANSI colors, which would make this work.

This could be controlled with a parameter, e.g. --color=auto, --color=console, --color=ansi, or something like that.

It could also check for the existence of $env:SSH_CONNECTION and switch to ANSI output automatically.

This shouldn't be too difficult to implement. If the logging system uses a command for color output, it could be overridden to use the appropriate system depending on the configuration.

rkitover avatar Dec 24 '21 01:12 rkitover

This would be useful for my purposes. I wanted to output choco through the information stream (Write-Host) for a PowerShell 5.1-compatible function I'm working on, but I haven't been able to preserve the color no matter what I've tried.

If there was an ANSI color output option, I'd be able to do this; though, depending on the implementation I might have to implement a workaround just for 5.1. But, one way or another, I'd get it working.

(Edit: Forgot to mention, know Start-Process is an option, but the function also uses Start-Transcript and for some reason that doesn't capture it.)

God-damnit-all avatar Aug 20 '23 15:08 God-damnit-all

I'm unable to read this text: image

and I can hardly read this text: image

In both cases I have to copy paste the text in a text editor in order to read it. Call me disabled and choco not doing a good inclusion job.

theking2 avatar Apr 17 '24 07:04 theking2