fansi Release Notes



This is a major release and includes some behavior changes.


Deprecated Functions

Behavior Changes

The major intentional behavior change is to default fansi to always recognize true color CSI SGR sequences (e.g. "ESC[38;2;128;50;245m"). The prior default was to match the active terminal capabilities, but it is unlikely that the intent of a user manipulating a string with truecolor sequences is to interpret them incorrectly, even if their terminal does. fansi will continue to warn in this case. To keep the pre-1.0 behavior add "old" to the term.cap parameter.

Additionally, to_html will now warn if it encounters unescaped HTML special character “<” or “>” in the input string.

Finally, the 1.0 release is an extensive refactoring of many parts of the SGR and OSC hyperlink controls (Special Sequences) intake and output algorithms. In some cases this means that some fansi functions will output Special Sequences slightly differently than they did before. In almost all cases the rendering of the output should remain unchanged, although there are some corner cases with changes (e.g. in strwrap_ctl SGRs embedded in whitespace sequences don’t break the sequence).

The changes are a side effect of applying more consistent treatment of corner cases around leading and trailing control sequences and (partially) invalid control sequences. Trailing Special Sequences in the output is now omitted as it would be immediately closed (assuming terminate=TRUE, the default). Leading SGR is interpreted and re-output.

Normally output consistency alone would not be a reason to change behavior, but in this case the changes should be almost always undetectable in the rendered output, and maintaining old inconsistent behavior in the midst of a complete refactoring of the internals was beyond my patience. I apologize if these behavior changes adversely affect your programs.

WARNING: we will strive to keep rendered appearance of fansi outputs consistent across releases, but the exact bytes used in the output of Special Sequences may change.

Other changes:

Bug Fixes

Internal Changes







Other minor fixes (#43, #46).





Initial release.