-
Notifications
You must be signed in to change notification settings - Fork 88
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
Reset sequence switches background to highlighted #64
Comments
I am having a look at this now. |
I can't reproduce with the most recent version of echo -e "Meow\n\033[1mLast segment %d (task index %d) completed: %s\033[0m\nMeow" | ./aha -b I am getting this result: <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- This file was created with the aha Ansi HTML Adapter. https://github.com/theZiz/aha -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xml+xhtml; charset=UTF-8"/>
<title>stdin</title>
</head>
<body style="color:white; background-color:black">
<pre>
Meow
<span style="font-weight:bold;">Last segment %d (task index %d) completed: %s</span>
Meow
</pre>
</body>
</html> So the most recent version does already fix your problem or I didn't understand it at all. 😅 You can easily test the most recent version by download from this repository and build yourself by just typing |
Thanks for having a look. I found a way to reproduce the error, including with the latest version, using part of a log file my system generate : test_file.txt
|
You can easily reproduce the wrong behavior with aha was incorrectly treating SGR 39 and 49 as fixed colors and set them to color 9 instead of resetting the color back to the default value. I opened PR #67 for this. |
Thank you for giving me an example, figuring out the error and fixing this! 😃 |
While using the black color scheme, the SGR 'reset' parameter 0 turns the background of all following lines to white.
As an example, this line:
\033[1mLast segment %d (task index %d) completed: %s\033[0m
Gets turned into:
</span><span style="color:white;font-weight:bold;">Last segment 0 (task index 2) completed: Succeeded!</span><span style="color:white;"></span><span style="color:white;background-color:white;">
I'm by no mean well versed in those things, but I've looked into it a little and I believe this is caused by some of the content of the background color array having the wrong index.
The text was updated successfully, but these errors were encountered: