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

Silently ignore charset escapes #60

Closed etaoins closed 5 years ago

etaoins commented 5 years ago

Rust tools such as Cargo and rustfmt seem to like resetting the charset to US ASCII by using ESC(B in the middle of a line. Currently this outputs a literal (B in the rendered HTML which makes the output look broken.

This simply discards the next character after any ESC( or ESC). Initially I only discarded B for US ASCII and let the other charsets through as their original escape sequence. However, the existing pattern in the code is to ignore any well-formed escape sequences even if their exact content isn't understood.

etaoins commented 5 years ago

Here's some examples of Rust's charset nervous tic:

Screen Shot 2019-03-19 at 07 49 19 Screen Shot 2019-03-19 at 07 49 28

The examples are from a build on this public Buildkite pipeline: https://buildkite.com/arret/arret/builds/374

keithpitt commented 5 years ago

@etaoins thanks for the PR - code's great - and thanks for updating the comments :)

keithpitt commented 5 years ago

@etaoins I'll push this out to BK later on today!

etaoins commented 5 years ago

@keithpitt All fixed, thanks for the quick turnaround!

Screen Shot 2019-03-19 at 16 22 25

keithpitt commented 5 years ago

@etaoins yay! 🎉