Skip to content

Reset all attributes after colorization #11

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kiwe
Copy link
Contributor

@kiwe kiwe commented Mar 5, 2015

Code 39 only resets the color to the default one, which leaves part of strings bold after using light_* colors.

@@ -955,7 +955,7 @@ static protected function _colorize($string, $color = null)
return $string;
}

$string = "\033[{$colorNumber}m" . $string . "\033[39m";
$string = "\033[{$colorNumber}m" . $string . "\033[0m";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing this out.
The problem with this is that background color will also be reset. I've changed the escape code to "\033[39;0m" which will reset bold state aswell. Let me know if this does the trick.

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

Successfully merging this pull request may close these issues.

2 participants