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

Escape sequences aren't displayed properly on Windows #702

Open
xenu opened this issue Jan 7, 2022 · 0 comments
Open

Escape sequences aren't displayed properly on Windows #702

xenu opened this issue Jan 7, 2022 · 0 comments

Comments

@xenu
Copy link

xenu commented Jan 7, 2022

See the screenshot:
dzil

An obvious fix would be something like this:

diff --git a/dist.ini b/dist.ini
index aede7ddf..336c5a88 100644
--- a/dist.ini
+++ b/dist.ini
@@ -52,6 +52,7 @@ DateTime = 0.44 ; CLDR fixes, used by AutoVersion and NextRelease

 [OSPrereqs / MSWin32]
 DateTime::TimeZone = 1.92
+Win32::Console::ANSI = 0

 [RemovePrereqs]
 remove = Config ; why isn't this indexed?? -- rjbs, 2011-02-11
diff --git a/lib/Dist/Zilla/Chrome/Term.pm b/lib/Dist/Zilla/Chrome/Term.pm
index d2661f11..9613572f 100644
--- a/lib/Dist/Zilla/Chrome/Term.pm
+++ b/lib/Dist/Zilla/Chrome/Term.pm
@@ -85,6 +85,7 @@ sub _build_logger {

     $stdout->add_callback(sub {
       require Term::ANSIColor;
+      require Win32::Console::ANSI if $^O eq 'MSWin32';
       my $message = {@_}->{message};
       return $message unless $message =~ s/\A\[([^\]]+)] //;

However, because dzil expects a 256-color terminal and Win32::Console::ANSI emulates a 16-color terminal, it doesn't look as intended:
dzil2

Maybe colouring should be completely disabled under Windows?

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

No branches or pull requests

1 participant