[DUX-3004]: handle evil clients that send ANSI escapes after NL #345
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Wew. That was a bug.
The reproducer is here: https://github.com/rampion/ghciwatch-bug-demo
After tracing
consume_str
, I found out that the cause of our problems is that hspec includes the NL in their coloured output before resetting colour.https://github.com/hspec/hspec/blob/fb9916f07e580f2572220d381e1886e765df95b7/hspec-core/src/Test/Hspec/Core/Formatters/Internal.hs#L297-L306
That means that it is a pain in the ass to parse, since it shoves random ANSI escapes onto the next line. The easiest, and probably most correct, solution to this is to just eat ANSI escapes while looking for markers.
patch
,minor
, ormajor
to request a version bump when it's merged.docs/
.tests/
.