Erasing the display should be done with only the background attribute of
the current pen. This is the current behavior but is done by altering
the current pen state. The pen state should remain after erasure. Use a
new pen variable to erase the display to enable retaining the pen state.
Add a test condition.
Each screen (primary and alternate) retains the state of the current
charset when DECSC (save cursor) is called. Move the CharsetState into
the screen to enable saving the state with each screen.
Add a test for charset state on screen change
The name sounds obvious, but nothing ever is with ANSI escapes. ICH
(Insert Blank Characters) should insert a cell with no attributes or
colors set.
Remove comment about inserting a space for tests: the tests pass with a
blank cell inserted.
Remove comment about inserted cells having current SGR.
Update tests to check for attribute of inserted cell.
When DCH (deleteChars) deletes cells from a line, cells are inserted
from the right. The new cells should not have the current pen style, and
should instead be an empty cell.
Add check for this in the existing test.
Fixes: alacritty/deccolm_reset
Add a check for 'has_bg', and if it is set retain the background color.
If it isn't set, we are safe to set the pen to it's default.
Fixes: alacritty/colored_reset
When erasing the display, all attributes of the pen must be cleared
_except_ for the background. Add unit tests for erasing the display in
all scenarios.
Fixes: alacritty/clear_underline
fullReset resets the state of the terminal. This method calls
eraseDisplay, which depends on the state of the cursor pen for setting
the cell styles when it erases. Reset the state of the cursor prior to
calling eraseDisplay to ensure a clean reset.
Fixes: alacritty/alt_reset test
Fixes#519
The core issue here was that `mouseEntered` was called AFTER
`cursorUpdate` (by Cocoa) so we were messing up our NSCursor state. To
fix this more robustly, all cursor state should ONLY be handled by
cursorUpdate and mouseEntered/Exit goes through that system now.
Fixes#518
This optimization to avoid a draw call to OpenGL was premature. This
optimization is fine but needs to happen only for the draw calls. We
still need to clear the screen if we have no cells.
This was causing #518 because when the cursor was blinked (invisible)
then we had no cells so we'd skip the draw call which reused the old
buffer state for OpenGL.