diff options
author | Christian Duerr <contact@christianduerr.com> | 2020-07-06 05:08:36 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-06 05:08:36 +0000 |
commit | 72c916ff434e23d44e2a31e6a8d5f7b8ae649008 (patch) | |
tree | 5060c4144153e2e55527c29aa109acec0c79fd85 /alacritty_terminal/src/grid/mod.rs | |
parent | 92ea355eeea538bd868eaebdc03469630aba281c (diff) | |
download | alacritty-72c916ff434e23d44e2a31e6a8d5f7b8ae649008.tar.gz alacritty-72c916ff434e23d44e2a31e6a8d5f7b8ae649008.zip |
Preserve linewrap flag across alt screen switches
While neither VTE, URxvt nor Kitty handle this, preserving the linewrap
flag across alternate screen switches seems like the correct thing to
do. XTerm also does handle this correctly, which indicates that it is a
bug and not a feature.
Diffstat (limited to 'alacritty_terminal/src/grid/mod.rs')
-rw-r--r-- | alacritty_terminal/src/grid/mod.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/alacritty_terminal/src/grid/mod.rs b/alacritty_terminal/src/grid/mod.rs index 5178ed99..5ad7e8d6 100644 --- a/alacritty_terminal/src/grid/mod.rs +++ b/alacritty_terminal/src/grid/mod.rs @@ -71,6 +71,16 @@ pub struct Cursor { /// Currently configured graphic character sets. pub charsets: Charsets, + + /// Tracks if the next call to input will need to first handle wrapping. + /// + /// This is true after the last column is set with the input function. Any function that + /// implicitly sets the line or column needs to set this to false to avoid wrapping twice. + /// + /// Tracking `input_needs_wrap` makes it possible to not store a cursor position that exceeds + /// the number of columns, which would lead to index out of bounds when interacting with arrays + /// without sanitization. + pub input_needs_wrap: bool, } #[derive(Debug, Default, Copy, Clone, PartialEq, Eq)] |