ansi icon indicating copy to clipboard operation
ansi copied to clipboard

Remove win32console requirement in ruby 2.0.0 and higher

Open Darunada opened this issue 9 years ago • 3 comments

This allows ansi to color output in windows with ruby 2+ without attempting to load win32console

The win32console gem is no longer required for ruby 2 or higher in Windows. See: https://github.com/luislavena/win32console/issues/17#issuecomment-20811539

Darunada avatar Jun 18 '16 19:06 Darunada

The CI check seems to fail because it's using an outdated version of bundler.

See: https://github.com/bundler/bundler/pull/3559

Darunada avatar Jun 18 '16 20:06 Darunada

Would it be possible to get this PR merged? A few gems depend on this ansi gem and on Windows it's often no color output as a result.

thomthom avatar Jun 17 '22 18:06 thomthom

For anyone else (or myself in the future) that might be looking for ways to address the issue of ansi not using color on Windows, here is an example of how I made minitest-reporters work:

# test_helper.rb

# Kludge: minitest-reporter depend on the `ansi` gem which hasn't been updated
# for a very long time. It's expecting to use another `win32console` gem in
# order to provide colorized output on Windows even though that is not longer
# needed. This works around that by fooling Ruby to think it has been loaded.
#
# https://github.com/rubyworks/ansi/issues/36
# https://github.com/rubyworks/ansi/pull/35
$LOADED_FEATURES << 'Win32/Console/ANSI'
Minitest::Reporters.use!

thomthom avatar Jun 17 '22 18:06 thomthom