Any row created from scrolling via IND ("\x1BD") should have it's
background set as the current background. This can be verified in any
terminal with
$ echo -e "\x1B[41m" && cat -v"
Followed by pressing enter to scroll the screen. We expect to see red
rows appear. Add test case to verify.
Fixes: alacritty/vim_large_screen_scroll
Instead of checking if a locale is valid, let's change this logic:
1. We first try setlocale to inherit from env vars, system default.
2. Next, we fall back to unsetting LANG if it was set manually,
allowing us to fall back to system defaults.
3. We fall back to en_US.UTF-8.
Add a configuration key for the TERM environment variable. Default this
to "ghostty". Most TEs are using their name as the default TERM value.
Most modern termulators aren't even providing "xterm-" as an alias
anymore, after some drama between kitty / ncurses.
Notably, this also has issues for tcell-based applications (I've
submitted a PR to tcell to fix) because it fails if the TERM value
doesn't match the _primary_ name of the terminal in the terminfo file.
Providing a config option allows users to modify-with-persistence if
they have issues, but Ghostty should be known as Ghostty by default!
When scrolling up or deleting lines (effectively the same operation),
the inserted lines should only inherit the bg attribute of the cursor.
This behavior is similar to erase display and erase line. Update tests
to reflect this behavior.
The XTVERSION response should use a string terminator instead of a bell.
Most terminals can handle the bell, however specifically tmux does not
like it.
Fixes: #534
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