The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Feature #13956

Colorize console output on Windows

Added by Josh Cooper over 2 years ago. Updated over 2 years ago.

Status:ClosedStart date:04/16/2012
Priority:NormalDue date:
Assignee:Josh Cooper% Done:

0%

Category:windows
Target version:2.7.15
Affected Puppet version:2.7.6 Branch:https://github.com/puppetlabs/puppet/pull/776
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

Windows consoles do not support ANSI escape sequences, and so Puppet by default disables colorizing output (on Windows). However, the win32console gem https://github.com/luislavena/win32console translates these escape sequences into the appropriate native console calls.

Ken has submitted fixes upstream to fix how foreground and background colors are preserved, which is an issue for powershell, since it’s default background is not black. Now that Ken’s fix has been merged, we should move forward with colorizing Windows console output by default.


Related issues

Related to Puppet Acceptance - Bug #14397: win32console 1.3.1 bug causing acceptance tests to fail Closed 05/10/2012
Related to Puppet - Bug #14242: Puppet errors with `--debug` flag and trying to colorize ... Closed 04/29/2012

History

#1 Updated by Jeff McCune over 2 years ago

Updated ruby.zip

I’ve updated the ruby.zip file to include win32console (1.3.1 x86-mingw32).

The windows MSI packages will now install this gem once new packages are built.

#2 Updated by Jeff McCune over 2 years ago

  • Assignee changed from Josh Cooper to Jeff McCune

Needs patches to 2.7.x

I have the gem installed and built into the package, but we still need to patch 2.7.x to take advantage of the gem.

I’m running Puppet 2.7.14rc2-11-gd0d34a7

Here’s a screenshot of what’s happening:

No Color on Windows

I’m looking into the patches required to Puppet now.

#3 Updated by Josh Cooper over 2 years ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Branch set to https://github.com/puppetlabs/puppet/pull/708

#4 Updated by Jeff McCune over 2 years ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release
  • Assignee deleted (Jeff McCune)
  • Target version changed from 2.7.x to 2.7.15

Merged into 2.7.x

As: https://github.com/puppetlabs/puppet/commit/64348a0

As 2.7.14 is in RC right now, I set the target version to 2.7.15.

#5 Updated by Josh Cooper over 2 years ago

  • Status changed from Merged - Pending Release to Code Insufficient
  • Assignee set to Josh Cooper

#6 Updated by Josh Cooper over 2 years ago

  • Status changed from Code Insufficient to In Topic Branch Pending Review
  • Target version changed from 2.7.15 to 2.7.x
  • Branch changed from https://github.com/puppetlabs/puppet/pull/708 to https://github.com/puppetlabs/puppet/pull/776

Commit https://github.com/puppetlabs/puppet/commit/64348a0 caused puppet to get into an recursive loop when the the win32console gem was not installed and running puppet with —debug. Commit #91a4a7d fixed this, but broke the case where the gem is installed (due to rubygems not yet being loaded). A new pull request has been submitted to get colorized output working again in 2.7.x

#7 Updated by Josh Cooper over 2 years ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release
  • Target version changed from 2.7.x to 2.7.15

#8 Updated by Moses Mendoza over 2 years ago

  • Status changed from Merged - Pending Release to Closed

released in 2.7.15rc1

Also available in: Atom PDF