buildkite / terminal-to-html

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

Ignore 2J & 3J "scrollback clear" codes #95

Open mipearson opened 2 years ago

mipearson commented 2 years ago

Discovered while trying to work out why our build output was coming up as if we'd hit the 1mb log limit .. and then find that instead terminal is respecting the ANSI code to clear the screen and/or the scrollback buffer.

Given the context where terminal is used, I don't think it should do this. At the very least it should instead clear the current line -- or if there's a way wrangle it in buildkite, insert a banner of some sort.

I've looked at making the code in the build not do this, but in doing so I keep finding issues like this one (https://github.com/facebook/create-react-app/issues/2495) where the project author is optimising for the console experience - but when viewing the BK log we generally want the whole thing.

(edit) In our case the code is outputting a 2J - clear screen without clearing scrollback - but the way it's represented in the BK build output is to make it look like the scrollback is gone as well.

mmlb commented 1 year ago

Oh I'd love this (or similar codes) too! My use case is watching bmc console output while a reboot happens. Some of the bmcs clear scrollback at the beginning of boot which makes the bk output not as great to use unless watching the logs in realtime. I'm currently |teeing and uploading to artifact store to be able to look back if needed.