This covers the behavior of clearing the screen and a row with colored
cells.
This covers a bug discovered in #2329 which was not detected in any
existing ref tests.
This fixes a bug that would clear the cells with the current template
cell with just the `flags` reset, to make sure the colors are correct.
However, the cell foreground was not reset, leading to cells counting as
occupied when resizing.
With this change both cell flags and foreground color are ignored when
clearing both the whole screen and inside the line, allowing us to
accurately keep track of cell occupation.
Fixes#2866.
Instead of ignoring unexpected intermediates in CSI escape sequences,
the intermediates are now explicitly checked and the escape sequence is
rejected when an unexpected intermediate is found.
Fixes#2171.
Since ref tests were only stored whenever winit requested the window
close, they would not get stored properly when the terminal was closed
through Alacritty using `exit`, Ctrl+D or similar.
This moves the ref test code to the and of the main entry point, which
will always be executed regardless of how the terminal was shutdown.
Fixes#2613.