-
Notifications
You must be signed in to change notification settings - Fork 2
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
add color for the MSWin32 platform #5
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The additional Perl::Critic directive can be dispensed with by using ...
if you prefer that implementation. |
21e0584
to
4db68a8
Compare
4db68a8
to
6ca7a9d
Compare
d22bbe5
to
578cda5
Compare
.# Discussion Term::ANSIColor doesn't include MSWin32 support by default. And, unfortunately, it seems that perl-porters don't want to include it (see https://rt.cpan.org/Ticket/Display.html?id=44807 @@ http://archive.is/gqB1N). So, to support the platform, Win32::Console::ANSI must be used whenever Term::ANSIColor is loaded. It's tiresome but has a simple fix. Adding `eval { require Win32::Console::ANSI }` after any require/use of Term::ANSIColor is all that is needed for MSWin32 support. Since Win32::Console::ANSI can only be installed on MSWin32 platforms, no `$^O eq 'MSWin32'` test is needed. But, since Win32::Console::ANSI is an optional dependency, keeping the platform test avoids exposing non-'MSWin32' platforms to the ". in @inc" threat vector. ref: https://dzone.com/articles/security-separation-of-concerns-and-cve-2016-1238 @@ https://archive.is/sKbcs
578cda5
to
f1a6928
Compare
I amended the PR to include the OS check (as well as the changing to a critic-compatible form). |
kentfredric
added a commit
that referenced
this pull request
Sep 10, 2016
kentfredric
added a commit
that referenced
this pull request
Sep 10, 2016
[Dependencies::Stats] - Dependencies changed since 1.000007, see misc/*.deps* for details - configure: (suggests: +1) - develop: +5 ↑1 -1 (suggests: ↑2) [Features / Win32 ANSI Colors] - ANSI Escape code colours should render correctly on Win32 if users have Win32::Console::ANSI installed. - Patched (with thanks) by Roy Ivy III ( #5 )
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
.# Discussion
Term::ANSIColor doesn't include MSWin32 support by default. And, unfortunately, it seems
that perl-porters don't want to include it (see https://rt.cpan.org/Ticket/Display.html?id=44807
@@ http://archive.is/gqB1N). So, to support the platform, Win32::Console::ANSI must be
used whenever Term::ANSIColor is loaded. It's tiresome but has a simple fix.
Adding
eval { require Win32::Console::ANSI }
after any require/use of Term::ANSIColor isall that is needed for MSWin32 support. Since Win32::Console::ANSI can only be installed
on MSWin32 platforms, no
$^O eq 'MSWin32'
test is needed.