Code Monkey home page Code Monkey logo

Comments (5)

theZiz avatar theZiz commented on July 18, 2024

I am having a look at this now.

from aha.

theZiz avatar theZiz commented on July 18, 2024

I can't reproduce with the most recent version of aha.
When I am doing this:

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 make and then call aha with ./aha to use the local version.

from aha.

AlexisGofman avatar AlexisGofman commented on July 18, 2024

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
I run: aha -b -f test_file.txt
And it outputs:

<!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>test_file.txt</title>
</head>
<body style="color:white; background-color:black">
<pre>
[/topological_graph_planner INFO 1568883670.939314]: Planner reset! (Initial vertex: initial_vertex, initial vertex edges: [], target vertex: target_vertex, target vertex edges: [])
[/navigation/navigation_manager INFO 1568883670.991375]: <span style="font-weight:bold;">New plan received: [1800005219900140044: shelf_reposition, 0: stop]</span><span style="color:white;"></span><span style="color:white;background-color:white;">
[/navigation/navigation_manager INFO 1568883671.000147]: Plan optimized. Modified tasks: approximate: 0, give-way-to-ctrl: 0, stop-if-dockable: 0
</span>
</pre>
</body>
</html>```

I'm not sure whether the flags are right in my file, since I can't seem to display them properly. Maybe something upstream is messing them up, in which case I apologise for bothering :)

from aha.

bhaak avatar bhaak commented on July 18, 2024

You can easily reproduce the wrong behavior with echo "\e[39mdefault foreground \e[49mdefault background" | aha -b -n.

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.

from aha.

theZiz avatar theZiz commented on July 18, 2024

Thank you for giving me an example, figuring out the error and fixing this! 😃

from aha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.