buildkite / terminal-to-html

Converts arbitrary shell output (with ANSI) into beautifully rendered HTML
http://buildkite.github.io/terminal-to-html
MIT License
649 stars 45 forks source link

Background colours not reset and various colours not respected #36

Closed josephmbeveridge closed 7 years ago

josephmbeveridge commented 7 years ago

It appears as though some of the colours aren't properly rendered, and clearing the background colour doesn't actually clear the background colour. As you can see from the expected screenshot (both using the same code), the background should end after P but it continues, and the yellow text isn't being shown.

Expected:

screen shot 2017-02-10 at 2 20 57 pm

Actual:

screen shot 2017-02-10 at 1 53 08 pm
josephmbeveridge commented 7 years ago

I don't know how to write the html for this properly, but here is the code required to show and stop showing a background partway through a line :) Should help with writing the test

Some plain text \e[0;30;42m yay a green background \e[0m now this has no background
Some plain text\e[0;30;42m yay a green background \e[0m\e[0;33;49mnow this has no background but is yellow \e[0m
ticky commented 7 years ago

Just had a dig into this - thanks for the report!

Looks like what’s happening is that Terminal is only treating the \e[0m as a foreground reset, not a reset of all overrides! I’ve beefed up our test case in #38.