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

Fix parameter-less resets #27

Closed toolmantim closed 9 years ago

toolmantim commented 9 years ago

If you're a hipster and use $(tput sgr0) (instead of \033[0m) then you'll get the escape sequence \033[m, which according to Wikipedia is a valid way of doing a reset:

After CSI can be zero or more parameters separated with ;. With no parameters, CSI m is treated as CSI 0 m (reset / normal), which is typical of most of the ANSI escape sequences.

We should treat \033[m the same as \033[0m

Fixes #28

toolmantim commented 9 years ago

@mipearson @keithpitt any idea how to fix the parser?

keithpitt commented 9 years ago

The answer is in here somewhere I think! https://github.com/buildkite/terminal/blob/b1c51da3204bb3ddce907ea91774607f43a54ec2/style.go#L88

lox commented 9 years ago

Doh. #28

keithpitt commented 9 years ago

This is a dup of https://github.com/buildkite/terminal/issues/28 - lolol.

toolmantim commented 9 years ago

Except this one is a PR with a failing test case!

keithpitt commented 9 years ago

More info here: https://github.com/buildkite/terminal/issues/28

keithpitt commented 9 years ago

I shouldn't be opening/closing PR's before I've had coffee :coffee:

lox commented 9 years ago

Good god man, how have you NOT had coffee yet?!

keithpitt commented 9 years ago

The grinder and aeropres are right next to me, but grinding is a lot of work, and clicking buttons is easier :P

mipearson commented 9 years ago

You have reached the voicemail of @mipearson.

@mipearson is drinking margaritas on a tropical island and cannot take your call.

Please leave your message after the intense sense of FOMO.

mipearson commented 9 years ago

fixed yo.

keithpitt commented 9 years ago

Voicemails can code!?