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

Handle ESC \ string terminators in OSC and APC #159

Closed DrJosh9000 closed 5 days ago

DrJosh9000 commented 5 days ago

Fixes #101 - note the description of #101 is a bit off. 0x9C is historical as a string terminator (ST), but a common ST in use today (e.g. for hyperlinks with the extension ESC ]8;;link ST) is actually the two byte sequence ESC \.

This is relevant to #58 as this is a step towards accepting at least one hyperlink extension known to iTerm (and others) in its possible forms. However this PR will break this amazing hack...

This PR includes a small tidyup of the parser modes enum. We don't use shouty-case constants in Go.

DrJosh9000 commented 5 days ago

I was shown some input (from a customer) that rendered strangely, which led me down the path of this fix, and I've tested it on that input.