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#359
See #359 for a test script. The unit tests were also wrong. I used the
test script in #359 to verify the exact column that tabstops should be
set at.
Fixes#298
This fix is quite simple and the code should be more or less obvious:
we weren't handling scroll regions properly for the reverse index (RI)
escape sequence.
Instead of sending formfeed (0x0C), clear_screen actually does a
terminal emulator level clear instead. This MOSTLY matches the behavior
of iTerm and Terminal.app, with some differences:
1. I do not clear _below_ the cursor. I feel like the use case for
this feature is primarily to clear above the cursor. Happy to be
wrong here but I want it proven to me!
2. I do not clear in alternate screen mode. Clearing alt screens
breaks rendering in Vim, less, etc. and it feels like the wrong
behavior.