Because we're printing the field's contents in multiple different places, I think it would make sense to wrap the Text in a newtype, and write a Buildable instance that automatically appends the reset sequence.
Acceptance criteria
ANSI control sequences are reset after a field's contents is printed on the terminal.
Clarification and motivation
The contents of a field may contain any and all unicode characters.
This means they can also include ANSI control sequences to, for example, turn the background red (
\x1b[41;1m
):This means that one field's control sequences can potentially affect the rest of
coffer
's output.To prevent this from happening, we should reset all ANSI control sequences (with
\x1b[0m
) after printing a field's contents.We could use the
ansi-terminal
package to do this.Because we're printing the field's contents in multiple different places, I think it would make sense to wrap the
Text
in a newtype, and write aBuildable
instance that automatically appends the reset sequence.Acceptance criteria