This fixes a bug where a row would always get reset completely if its
background does not equal the default terminal background. This leads to
big performance bottlenecks when running commands like `echo "\e[41m" &&
yes`.
Instead of resetting the entire row whenever the template cell is not
empty, the template cell is now compared to the last cell in the row.
The last cell will always be equal to the previous template cell when
`row.occ < row.inner.len()` and if `occ` is equal to the row's length,
the entire row is always reset anyways.
Fixes#2989.
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.