diff options
| author | Aram Drevekenin <aram@poor.dev> | 2021-05-03 19:11:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-03 19:11:31 +0200 |
| commit | 845211c1eebdbc6d063cf30de23135cff1582084 (patch) | |
| tree | f011f8bdcf4b3e1d67fa1487514f7df75a178d17 /src/client | |
| parent | Merge pull request #437 from a-kenji/xrdb-loading-fix (diff) | |
| download | sl0ppij-845211c1eebdbc6d063cf30de23135cff1582084.tar.gz sl0ppij-845211c1eebdbc6d063cf30de23135cff1582084.tar.xz sl0ppij-845211c1eebdbc6d063cf30de23135cff1582084.zip | |
Terminal compatibility: Pass vttest 2 and 3 (#447)
* fix(compatibility): pass vttest 2+3
* style(fmt): rustfmt
* style(comment): remove unused
* docs(changelog): update change
Diffstat (limited to 'src/client')
19 files changed, 925 insertions, 37 deletions
diff --git a/src/client/panes/grid.rs b/src/client/panes/grid.rs index 162af1e6..e0d460d2 100644 --- a/src/client/panes/grid.rs +++ b/src/client/panes/grid.rs @@ -1,6 +1,6 @@ use std::{ cmp::Ordering, - collections::VecDeque, + collections::{BTreeSet, VecDeque}, fmt::{self, Debug, Formatter}, }; @@ -10,7 +10,8 @@ const SCROLL_BACK: usize = 10_000; use crate::utils::logging::debug_log_to_file; use crate::panes::terminal_character::{ - CharacterStyles, TerminalCharacter, EMPTY_TERMINAL_CHARACTER, + CharacterStyles, CharsetIndex, Cursor, StandardCharset, TerminalCharacter, + EMPTY_TERMINAL_CHARACTER, }; fn get_top_non_canonical_rows(rows: &mut Vec<Row>) -> Vec<Row> { @@ -150,18 +151,34 @@ fn bounded_push(vec: &mut VecDeque<Row>, value: Row) { vec.push_back(value) } +pub fn create_horizontal_tabstops(columns: usize) -> BTreeSet<usize> { + let mut i = TABSTOP_WIDTH; + let mut horizontal_tabstops = BTreeSet::new(); + loop { + if i > columns { + break; + } + horizontal_tabstops.insert(i); + i += TABSTOP_WIDTH; + } + horizontal_tabstops +} + #[derive(Clone)] pub struct Grid { lines_above: VecDeque<Row>, viewport: Vec<Row>, lines_below: Vec<Row>, + horizontal_tabstops: BTreeSet<usize>, alternative_lines_above_viewport_and_cursor: Option<(VecDeque<Row>, Vec<Row>, Cursor)>, cursor: Cursor, + saved_cursor_position: Option<Cursor>, scroll_region: Option<(usize, usize)>, - pending_styles: CharacterStyles, + active_charset: CharsetIndex, pub should_render: bool, pub cursor_key_mode: bool, // DECCKM - when set, cursor keys should send ANSI direction codes (eg. "OD") instead of the arrow keys (eg. "[D") pub erasure_mode: bool, // ERM + pub disable_linewrap: bool, pub clear_viewport_before_rendering: bool, pub width: usize, pub height: usize, @@ -186,31 +203,67 @@ impl Grid { lines_above: VecDeque::with_capacity(SCROLL_BACK), viewport: vec![Row::new().canonical()], lines_below: vec![], + horizontal_tabstops: create_horizontal_tabstops(columns), cursor: Cursor::new(0, 0), + saved_cursor_position: None, scroll_region: None, width: columns, height: rows, - pending_styles: CharacterStyles::new(), should_render: true, cursor_key_mode: false, erasure_mode: false, + disable_linewrap: false, alternative_lines_above_viewport_and_cursor: None, clear_viewport_before_rendering: false, + active_charset: Default::default(), } } pub fn contains_widechar(&self) -> bool { self.viewport.iter().any(|c| c.contains_widechar()) } pub fn advance_to_next_tabstop(&mut self, styles: CharacterStyles) { - let columns_until_next_tabstop = TABSTOP_WIDTH - (self.cursor.x % TABSTOP_WIDTH); - let columns_until_screen_end = (self.width - self.cursor.x).saturating_sub(1); - let columns_to_advance = - std::cmp::min(columns_until_next_tabstop, columns_until_screen_end); + let mut next_tabstop = None; + for tabstop in self.horizontal_tabstops.iter() { + if *tabstop > self.cursor.x { + next_tabstop = Some(tabstop); + break; + } + } + match next_tabstop { + Some(tabstop) => { + self.cursor.x = *tabstop; + } + None => { + self.cursor.x = self.width.saturating_sub(1); + } + } let mut empty_character = EMPTY_TERMINAL_CHARACTER; empty_character.styles = styles; - self.cursor.x += columns_to_advance; self.pad_current_line_until(self.cursor.x); } + fn set_horizontal_tabstop(&mut self) { + self.horizontal_tabstops.insert(self.cursor.x); + } + fn clear_tabstop(&mut self, position: usize) { + self.horizontal_tabstops.remove(&position); + } + fn clear_all_tabstops(&mut self) { + self.horizontal_tabstops.clear(); + } + fn save_cursor_position(&mut self) { + self.saved_cursor_position = Some(self.cursor.clone()); + } + fn restore_cursor_position(&mut self) { + if let Some(saved_cursor_position) = self.saved_cursor_position.as_ref() { + self.cursor = saved_cursor_position.clone(); + } + } + fn configure_charset(&mut self, charset: StandardCharset, index: CharsetIndex) { + self.cursor.charsets[index] = charset; + } + fn set_active_charset(&mut self, index: CharsetIndex) { + self.active_charset = index; + } fn cursor_canonical_line_index(&self) -> usize { let mut cursor_canonical_line_index = 0; let mut canonical_lines_traversed = 0; @@ -567,6 +620,9 @@ impl Grid { pub fn add_character(&mut self, terminal_character: TerminalCharacter) { // TODO: try to separate adding characters from moving the cursors in this function if self.cursor.x >= self.width { + if self.disable_linewrap { + return; + } // line wrap self.cursor.x = 0; if self.cursor.y == self.height - 1 { @@ -676,6 +732,13 @@ impl Grid { } } pub fn move_cursor_up(&mut self, count: usize) { + if let Some((scroll_region_top, scroll_region_bottom)) = self.scroll_region { + if self.cursor.y >= scroll_region_top && self.cursor.y <= scroll_region_bottom { + self.cursor.y = + std::cmp::max(self.cursor.y.saturating_sub(count), scroll_region_top); + return; + } + } self.cursor.y = if self.cursor.y < count { 0 } else { @@ -702,6 +765,12 @@ impl Grid { } } pub fn move_cursor_down(&mut self, count: usize, pad_character: TerminalCharacter) { + if let Some((scroll_region_top, scroll_region_bottom)) = self.scroll_region { + if self.cursor.y >= scroll_region_top && self.cursor.y <= scroll_region_bottom { + self.cursor.y = std::cmp::min(self.cursor.y + count, scroll_region_bottom); + return; + } + } let lines_to_add = if self.cursor.y + count > self.height - 1 { (self.cursor.y + count) - (self.height - 1) } else { @@ -841,16 +910,21 @@ impl Grid { self.scroll_region = None; self.clear_viewport_before_rendering = true; self.cursor = Cursor::new(0, 0); + self.saved_cursor_position = None; + self.active_charset = Default::default(); + self.erasure_mode = false; + self.disable_linewrap = false; } } impl vte::Perform for Grid { fn print(&mut self, c: char) { + let c = self.cursor.charsets[self.active_charset].map(c); // apparently, building TerminalCharacter like this without a "new" method // is a little faster let terminal_character = TerminalCharacter { character: c, - styles: self.pending_styles, + styles: self.cursor.pending_styles, }; self.add_character(terminal_character); } @@ -863,17 +937,23 @@ impl vte::Perform for Grid { } 9 => { // tab - self.advance_to_next_tabstop(self.pending_styles); + self.advance_to_next_tabstop(self.cursor.pending_styles); } 10 | 11 => { // 0a, newline - // 0b, form-feed + // 0b, vertical tabulation self.add_newline(); } 13 => { // 0d, carriage return self.move_cursor_to_beginning_of_line(); } + 14 => { + self.set_active_charset(CharsetIndex::G1); + } + 15 => { + self.set_active_charset(CharsetIndex::G0); + } _ => {} } } @@ -896,7 +976,9 @@ impl vte::Perform for Grid { fn csi_dispatch(&mut self, params: &[i64], _intermediates: &[u8], _ignore: bool, c: char) { if c == 'm' { - self.pending_styles.add_style_from_ansi_params(params); + self.cursor + .pending_styles + .add_style_from_ansi_params(params); } else if c == 'C' { // move cursor forward let move_by = if params[0] == 0 { @@ -909,11 +991,11 @@ impl vte::Perform for Grid { // clear line (0 => right, 1 => left, 2 => all) if params[0] == 0 { let mut char_to_replace = EMPTY_TERMINAL_CHARACTER; - char_to_replace.styles = self.pending_styles; + char_to_replace.styles = self.cursor.pending_styles; self.replace_characters_in_line_after_cursor(char_to_replace); } else if params[0] == 1 { let mut char_to_replace = EMPTY_TERMINAL_CHARACTER; - char_to_replace.styles = self.pending_styles; + char_to_replace.styles = self.cursor.pending_styles; self.replace_characters_in_line_before_cursor(char_to_replace); } else if params[0] == 2 { self.clear_cursor_line(); @@ -921,7 +1003,7 @@ impl vte::Perform for Grid { } else if c == 'J' { // clear all (0 => below, 1 => above, 2 => all, 3 => saved) let mut char_to_replace = EMPTY_TERMINAL_CHARACTER; - char_to_replace.styles = self.pending_styles; + char_to_replace.styles = self.cursor.pending_styles; if params[0] == 0 { self.clear_all_after_cursor(char_to_replace); } else if params[0] == 1 { @@ -1008,6 +1090,9 @@ impl vte::Perform for Grid { Some(&6) => { self.erasure_mode = false; } + Some(&7) => { + self.disable_linewrap = true; + } _ => {} }; } @@ -1048,6 +1133,9 @@ impl vte::Perform for Grid { Some(&6) => { self.erasure_mode = true; } + Some(&7) => { + self.disable_linewrap = false; + } _ => {} }; } @@ -1057,6 +1145,10 @@ impl vte::Perform for Grid { let top_line_index = (params[0] as usize).saturating_sub(1); let bottom_line_index = (params[1] as usize).saturating_sub(1); self.set_scroll_region(top_line_index, bottom_line_index); + if self.erasure_mode { + self.move_cursor_to_line(top_line_index, EMPTY_TERMINAL_CHARACTER); + self.move_cursor_to_beginning_of_line(); + } self.show_cursor(); } else { self.clear_scroll_region(); @@ -1088,6 +1180,12 @@ impl vte::Perform for Grid { params[0] as usize - 1 }; self.move_cursor_to_column(column); + } else if c == 'g' { + if params[0] == 0 { + self.clear_tabstop(self.cursor.x); + } else if params[0] == 3 { + self.clear_all_tabstops(); + } } else if c == 'd' { // goto line let line = if params[0] == 0 { @@ -1105,7 +1203,7 @@ impl vte::Perform for Grid { } else { params[0] as usize }; - self.erase_characters(count, self.pending_styles); + self.erase_characters(count, self.cursor.pending_styles); } else if c == 'X' { // erase characters and replace with empty characters of current style let count = if params[0] == 0 { @@ -1113,7 +1211,7 @@ impl vte::Perform for Grid { } else { params[0] as usize }; - self.replace_with_empty_chars(count, self.pending_styles); + self.replace_with_empty_chars(count, self.cursor.pending_styles); } else if c == 'T' { /* * 124 54 T SD @@ -1136,6 +1234,10 @@ impl vte::Perform for Grid { params[0] as usize }; self.rotate_scroll_region_down(count); + } else if c == 's' { + self.save_cursor_position(); + } else if c == 'u' { + self.restore_cursor_position(); } else if c == '@' { let count = if params[0] == 0 { 1 @@ -1153,6 +1255,35 @@ impl vte::Perform for Grid { fn esc_dispatch(&mut self, intermediates: &[u8], _ignore: bool, byte: u8) { match (byte, intermediates.get(0)) { + (b'B', charset_index_symbol) => { + let charset_index: CharsetIndex = match charset_index_symbol { + Some(b'(') => CharsetIndex::G0, + Some(b')') => CharsetIndex::G1, + Some(b'*') => CharsetIndex::G2, + Some(b'+') => CharsetIndex::G3, + _ => { + // invalid, silently do nothing + return; + } + }; + self.configure_charset(StandardCharset::Ascii, charset_index); + } + (b'0', charset_index_symbol) => { + let charset_index: CharsetIndex = match charset_index_symbol { + Some(b'(') => CharsetIndex::G0, + Some(b')') => CharsetIndex::G1, + Some(b'*') => CharsetIndex::G2, + Some(b'+') => CharsetIndex::G3, + _ => { + // invalid, silently do nothing + return; + } + }; + self.configure_charset( + StandardCharset::SpecialCharacterAndLineDrawing, + charset_index, + ); + } (b'D', None) => { self.add_newline(); } @@ -1167,7 +1298,13 @@ impl vte::Perform for Grid { self.reset_terminal_state(); } (b'H', None) => { - self.advance_to_next_tabstop(self.pending_styles); + self.set_horizontal_tabstop(); + } + (b'7', None) => { + self.save_cursor_position(); + } + (b'8', None) => { + self.restore_cursor_position(); } (b'8', Some(b'#')) => { let mut fill_character = EMPTY_TERMINAL_CHARACTER; @@ -1311,23 +1448,6 @@ impl Row { } } -#[derive(Clone, Debug)] -pub struct Cursor { - x: usize, - y: usize, - is_hidden: bool, -} - -impl Cursor { - pub fn new(x: usize, y: usize) -> Self { - Cursor { - x, - y, - is_hidden: false, - } - } -} - #[cfg(test)] #[path = "./unit/grid_tests.rs"] mod grid_tests; diff --git a/src/client/panes/terminal_character.rs b/src/client/panes/terminal_character.rs index 94620bba..31e017b1 100644 --- a/src/client/panes/terminal_character.rs +++ b/src/client/panes/terminal_character.rs @@ -1,7 +1,8 @@ use unicode_width::UnicodeWidthChar; use crate::utils::logging::debug_log_to_file; -use ::std::fmt::{self, Debug, Display, Formatter}; +use std::fmt::{self, Debug, Display, Formatter}; +use std::ops::{Index, IndexMut}; pub const EMPTY_TERMINAL_CHARACTER: TerminalCharacter = TerminalCharacter { character: ' ', @@ -625,6 +626,115 @@ impl Display for CharacterStyles { } } +#[derive(Clone, Copy, Debug)] +pub enum CharsetIndex { + G0, + G1, + G2, + G3, +} + +impl Default for CharsetIndex { + fn default() -> Self { + CharsetIndex::G0 + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum StandardCharset { + Ascii, + SpecialCharacterAndLineDrawing, +} + +impl Default for StandardCharset { + fn default() -> Self { + StandardCharset::Ascii + } +} + +impl StandardCharset { + /// Switch/Map character to the active charset. Ascii is the common case and + /// for that we want to do as little as possible. + #[inline] + pub fn map(self, c: char) -> char { + match self { + StandardCharset::Ascii => c, + StandardCharset::SpecialCharacterAndLineDrawing => match c { + '`' => '◆', + 'a' => '▒', + 'b' => '␉', + 'c' => '␌', + 'd' => '␍', + 'e' => '␊', + 'f' => '°', + 'g' => '±', + 'h' => '', + 'i' => '␋', + 'j' => '┘', + 'k' => '┐', + 'l' => '┌', + 'm' => '└', + 'n' => '┼', + 'o' => '⎺', + 'p' => '⎻', + 'q' => '─', + 'r' => '⎼', + 's' => '⎽', + 't' => '├', + 'u' => '┤', + 'v' => '┴', + 'w' => '┬', + 'x' => '│', + 'y' => '≤', + 'z' => '≥', + '{' => 'π', + '|' => '≠', + '}' => '£', + '~' => '·', + _ => c, + }, + } + } +} + +#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)] +pub struct Charsets([StandardCharset; 4]); + +impl Index<CharsetIndex> for Charsets { + type Output = StandardCharset; + + fn index(&self, index: CharsetIndex) -> &StandardCharset { + &self.0[index as usize] + } +} + +impl IndexMut<CharsetIndex> for Charsets { + fn index_mut(&mut self, index: CharsetIndex) -> &mut StandardCharset { + &mut self.0[index as usize] + } +} + +#[derive(Clone, Debug)] +pub struct Cursor { + pub x: usize, + pub y: usize, + pub is_hidden: bool, + pub pending_styles: CharacterStyles, + pub charsets: Charsets, +} + +impl Cursor { + pub fn new(x: usize, y: usize) -> Self { + Cursor { + x, + y, + is_hidden: false, + pending_styles: CharacterStyles::new(), + charsets: Default::default(), + } + } +} + #[derive(Clone, Copy)] pub struct TerminalCharacter { pub character: char, diff --git a/src/client/panes/unit/grid_tests.rs b/src/client/panes/unit/grid_tests.rs index 92f5fbdf..f2de7d56 100644 --- a/src/client/panes/unit/grid_tests.rs +++ b/src/client/panes/unit/grid_tests.rs @@ -83,3 +83,195 @@ fn vttest1_5() { } assert_snapshot!(format!("{:?}", grid)); } + +#[test] +fn vttest2_0() { + let mut vte_parser = vte::Parser::new(); + let mut grid = Grid::new(41, 110); + let fixture_name = "vttest2-0"; + let content = read_fixture(fixture_name); + for byte in content { + vte_parser.advance(&mut grid, byte); + } + assert_snapshot!(format!("{:?}", grid)); +} + +#[test] +fn vttest2_1() { + let mut vte_parser = vte::Parser::new(); + let mut grid = Grid::new(41, 110); + let fixture_name = "vttest2-1"; + let content = read_fixture(fixture_name); + for byte in content { + vte_parser.advance(&mut grid, byte); + } + assert_snapshot!(format!("{:?}", grid)); +} + +#[test] +fn vttest2_2() { + let mut vte_parser = vte::Parser::new(); + let mut grid = Grid::new(41, 110); + let fixture_name = "vttest2-2"; + let content = read_fixture(fixture_name); + for byte in content { + vte_parser.advance(&mut grid, byte); + } + assert_snapshot!(format!("{:?}", grid)); +} + +#[test] +fn vttest2_3() { + let mut vte_parser = vte::Parser::new(); + let mut grid = Grid::new(41, 110); + let fixture_name = "vttest2-3"; + let content = read_fixture(fixture_name); + for byte in content { + vte_parser.advance(&mut grid, byte); + } + assert_snapshot!(format!("{:?}", grid)); +} + +#[test] +fn vttest2_4() { + let mut vte_parser = vte::Parser::new(); + let mut grid = Grid::new(41, 110); + let fixture_name = "vttest2-4"; + let content = read_fixture(fixture_name); + for byte in content { + vte_parser.advance(&mut grid, byte); + } + assert_snapshot!(format!("{:?}", grid)); +} + +#[test] +fn vttest2_5() { + let mut vte_parser = vte::Parser::new(); + let mut grid = Grid::new(41, 110); + let fixture_name = "vttest2-5"; + let content = read_fixture(fixture_name); + for byte in content { + vte_parser.advance(&mut grid, byte); + } + assert_snapshot!(format!("{:?}", grid)); +} + +#[test] +fn vttest2_6() { + let mut vte_parser = vte::Parser::new(); + let mut grid = Grid::new(41, 110); + let fixture_name = "vttest2-6"; + let content = read_fixture(fixture_name); + for byte in content { + vte_parser.advance(&mut grid, byte); + } + assert_snapshot!(format!("{:?}", grid)); +} + +#[test] +fn vttest2_7() { + let mut vte_parser = vte::Parser::new(); + let mut grid = Grid::new(41, 110); + let fixture_name = "vttest2-7"; + let content = read_fixture(fixture_name); + for byte in content { + vte_parser.advance(&mut grid, byte); + } + assert_snapshot!(format!("{:?}", grid)); +} + +#[test] +fn vttest2_8() { + let mut vte_parser = vte::Parser::new(); + let mut grid = Grid::new(41, 110); + let fixture_name = "vttest2-8"; + let content = read_fixture(fixture_name); + for byte in content { + vte_parser.advance(&mut grid, byte); + } + assert_snapshot!(format!("{:?}", grid)); +} + +#[test] +fn vttest2_9() { + let mut vte_parser = vte::Parser::new(); + let mut grid = Grid::new(41, 110); + let fixture_name = "vttest2-9"; + let content = read_fixture(fixture_name); + for byte in content { + vte_parser.advance(&mut grid, byte); + } + assert_snapshot!(format!("{:?}", grid)); +} + +#[test] +fn vttest2_10() { + let mut vte_parser = vte::Parser::new(); + let mut grid = Grid::new(41, 110); + let fixture_name = "vttest2-10"; + let content = read_fixture(fixture_name); + for byte in content { + vte_parser.advance(&mut grid, byte); + } + assert_snapshot!(format!("{:?}", grid)); +} + +#[test] +fn vttest2_11() { + let mut vte_parser = vte::Parser::new(); + let mut grid = Grid::new(41, 110); + let fixture_name = "vttest2-11"; + let content = read_fixture(fixture_name); + for byte in content { + vte_parser.advance(&mut grid, byte); + } + assert_snapshot!(format!("{:?}", grid)); +} + +#[test] +fn vttest2_12() { + let mut vte_parser = vte::Parser::new(); + let mut grid = Grid::new(41, 110); + let fixture_name = "vttest2-12"; + let content = read_fixture(fixture_name); + for byte in content { + vte_parser.advance(&mut grid, byte); + } + assert_snapshot!(format!("{:?}", grid)); +} + +#[test] +fn vttest2_13() { + let mut vte_parser = vte::Parser::new(); + let mut grid = Grid::new(41, 110); + let fixture_name = "vttest2-13"; + let content = read_fixture(fixture_name); + for byte in content { + vte_parser.advance(&mut grid, byte); + } + assert_snapshot!(format!("{:?}", grid)); +} + +#[test] +fn vttest2_14() { + let mut vte_parser = vte::Parser::new(); + let mut grid = Grid::new(41, 110); + let fixture_name = "vttest2-14"; + let content = read_fixture(fixture_name); + for byte in content { + vte_parser.advance(&mut grid, byte); + } + assert_snapshot!(format!("{:?}", grid)); +} + +#[test] +fn vttest3_0() { + let mut vte_parser = vte::Parser::new(); + let mut grid = Grid::new(41, 110); + let fixture_name = "vttest3-0"; + let content = read_fixture(fixture_name); + for byte in content { + vte_parser.advance(&mut grid, byte); + } + assert_snapshot!(format!("{:?}", grid)); +} diff --git a/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_0.snap b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_0.snap new file mode 100644 index 00000000..506c2226 --- /dev/null +++ b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_0.snap @@ -0,0 +1,28 @@ +--- +source: src/client/panes/./unit/grid_tests.rs +expression: "format!(\"{:?}\", grid)" + +--- +00 (C): ************************************************************************************************************** +01 (C): ************************************************** +02 (C): ************************************************************************************************************** +03 (C): +04 (C): This should be three identical lines of *'s completely filling +05 (C): the top of the screen without any empty lines between. +06 (C): (Test of WRAP AROUND mode setting.) +07 (C): Push <RETURN> +08 (C): +09 (C): +10 (C): +11 (C): +12 (C): +13 (C): +14 (C): +15 (C): +16 (C): +17 (C): +18 (C): +19 (C): +20 (C): +21 (C): + diff --git a/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_1.snap b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_1.snap new file mode 100644 index 00000000..48e47687 --- /dev/null +++ b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_1.snap @@ -0,0 +1,28 @@ +--- +source: src/client/panes/./unit/grid_tests.rs +expression: "format!(\"{:?}\", grid)" + +--- +00 (C): * * * * * * * * * * * * * +01 (C): * * * * * * * * * * * * * +02 (C): +03 (C): Test of TAB setting/resetting. These two lines +04 (C): should look the same. Push <RETURN> +05 (C): +06 (C): +07 (C): +08 (C): +09 (C): +10 (C): +11 (C): +12 (C): +13 (C): +14 (C): +15 (C): +16 (C): +17 (C): +18 (C): +19 (C): +20 (C): +21 (C): + diff --git a/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_10.snap b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_10.snap new file mode 100644 index 00000000..dbacac54 --- /dev/null +++ b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_10.snap @@ -0,0 +1,30 @@ +--- +source: src/client/panes/./unit/grid_tests.rs +expression: "format!(\"{:?}\", grid)" + +--- +00 (W): +01 (W): +02 (W): +03 (W): +04 (W): +05 (W): +06 (W): +07 (W): +08 (W): +09 (W): +10 (W): +11 (W): +12 (W): +13 (W): +14 (W): +15 (W): +16 (W): +17 (W): +18 (W): +19 (W): +20 (W): +21 (W): +22 (W): This line should be the one above the bottom of the screen. Push <RETURN> +23 (W): Origin mode test. This line should be at the bottom of the screen. + diff --git a/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_11.snap b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_11.snap new file mode 100644 index 00000000..3c424d45 --- /dev/null +++ b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_11.snap @@ -0,0 +1,30 @@ +--- +source: src/client/panes/./unit/grid_tests.rs +expression: "format!(\"{:?}\", grid)" + +--- +00 (W): This line should be at the top of the screen. Push <RETURN> +01 (W): +02 (W): +03 (W): +04 (W): +05 (W): +06 (W): +07 (W): +08 (W): +09 (W): +10 (W): +11 (W): +12 (W): +13 (W): +14 (W): +15 (W): +16 (W): +17 (W): +18 (W): +19 (W): +20 (W): +21 (W): +22 (W): +23 (W): Origin mode test. This line should be at the bottom of the screen. + diff --git a/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_12.snap b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_12.snap new file mode 100644 index 00000000..fc2bd2de --- /dev/null +++ b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_12.snap @@ -0,0 +1,30 @@ +--- +source: src/client/panes/./unit/grid_tests.rs +expression: "format!(\"{:?}\", grid)" + +--- +00 (W): Graphic rendition test pattern: +01 (W): +02 (W): +03 (W): vanilla bold +04 (W): +05 (W): underline bold underline +06 (W): +07 (W): blink bold blink +08 (W): +09 (W): underline blink bold underline blink +10 (W): +11 (W): negative bold negative +12 (W): +13 (W): underline negative bold underline negative +14 (W): +15 (W): blink negative bold blink negative +16 (W): +17 (W): underline blink negative bold underline blink negative +18 (W): +19 (W): +20 (W): +21 (W): +22 (W): Dark background. Push <RETURN> +23 (W): + diff --git a/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_13.snap b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_13.snap new file mode 100644 index 00000000..a79bc0cd --- /dev/null +++ b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_13.snap @@ -0,0 +1,30 @@ +--- +source: src/client/panes/./unit/grid_tests.rs +expression: "format!(\"{:?}\", grid)" + +--- +00 (W): Graphic rendition test pattern: +01 (W): +02 (W): +03 (W): vanilla bold +04 (W): +05 (W): underline bold underline +06 (W): +07 (W): blink bold blink +08 (W): +09 (W): underline blink bold underline blink +10 (W): +11 (W): negative bold negative +12 (W): +13 (W): underline negative bold underline negative +14 (W): +15 (W): blink negative bold blink negative +16 (W): +17 (W): underline blink negative bold underline blink negative +18 (W): +19 (W): +20 (W): +21 (W): +22 (W): Light background. Push <RETURN> +23 (W): + diff --git a/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_14.snap b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_14.snap new file mode 100644 index 00000000..dbdc3dc1 --- /dev/null +++ b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_14.snap @@ -0,0 +1,30 @@ +--- +source: src/client/panes/./unit/grid_tests.rs +expression: "format!(\"{:?}\", grid)" + +--- +00 (W): AAAAA +01 (W): AAAAA +02 (W): AAAAA +03 (W): AAAAA +04 (W): +05 (W): +06 (W): +07 (W): normal bold underscored blinking reversed +08 (W): +09 (W): stars: ********** ********** ********** ********** ********** +10 (W): +11 (W): line: ────────── ────────── ────────── ────────── ────────── +12 (W): +13 (W): x'es: xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx +14 (W): +15 (W): diamonds: ◆◆◆◆◆◆◆◆◆◆ ◆◆◆◆◆◆◆◆◆◆ ◆◆◆◆◆◆◆◆◆◆ ◆◆◆◆◆◆◆◆◆◆ ◆◆◆◆◆◆◆◆◆◆ +16 (W): +17 (W): +18 (W): +19 (W): +20 (W): Test of the SAVE/RESTORE CURSOR feature. There should +21 (W): be ten characters of each flavour, and a rectangle +22 (W): of 5 x 4 A's filling the top left of the screen. +23 (W): Push <RETURN> + diff --git a/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_2.snap b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_2.snap new file mode 100644 index 00000000..7b03c147 --- /dev/null +++ b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_2.snap @@ -0,0 +1,28 @@ +--- +source: src/client/panes/./unit/grid_tests.rs +expression: "format!(\"{:?}\", grid)" + +--- +00 (C): 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 +01 (C): 123456789012345678901 +02 (C): This is 132 column mode, light background. +03 (C): This is 132 column mode, light background. +04 (C): This is 132 column mode, light background. +05 (C): This is 132 column mode, light background. +06 (C): This is 132 column mode, light background. +07 (C): This is 132 column mode, light background. +08 (C): This is 132 column mode, light background. +09 (C): This is 132 column mode, light background. +10 (C): This is 132 column mode, light background. +11 (C): This is 132 column mode, light background. +12 (C): This is 132 column mode, light background. +13 (C): This is 132 column mode, light background. +14 (C): This is 132 column mode, light background. +15 (C): This is 132 column mode, light background. +16 (C): This is 132 column mode, light background. +17 (C): This is 132 column mode, light background. +18 (C): This is 132 column mode, light background. +19 (C): This is 132 column mode, light background.Push <RETURN> +20 (C): +21 (C): + diff --git a/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_3.snap b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_3.snap new file mode 100644 index 00000000..98620a5c --- /dev/null +++ b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_3.snap @@ -0,0 +1,28 @@ +--- +source: src/client/panes/./unit/grid_tests.rs +expression: "format!(\"{:?}\", grid)" + +--- +00 (C): 1234567890123456789012345678901234567890123456789012345678901234567890123456789 +01 (C): +02 (C): This is 80 column mode, light background. +03 (C): This is 80 column mode, light background. +04 (C): This is 80 column mode, light background. +05 (C): This is 80 column mode, light background. +06 (C): This is 80 column mode, light background. +07 (C): This is 80 column mode, light background. +08 (C): This is 80 column mode, light background. +09 (C): This is 80 column mode, light background. +10 (C): This is 80 column mode, light background. +11 (C): This is 80 column mode, light background. +12 (C): This is 80 column mode, light background. +13 (C): This is 80 column mode, light background. +14 (C): This is 80 column mode, light background. +15 (C): This is 80 column mode, light background. +16 (C): This is 80 column mode, light background. +17 (C): This is 80 column mode, light background. +18 (C): This is 80 column mode, light background. +19 (C): This is 80 column mode, light background.Push <RETURN> +20 (C): +21 (C): + diff --git a/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_4.snap b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_4.snap new file mode 100644 index 00000000..35802e63 --- /dev/null +++ b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_4.snap @@ -0,0 +1,28 @@ +--- +source: src/client/panes/./unit/grid_tests.rs +expression: "format!(\"{:?}\", grid)" + +--- +00 (C): 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 +01 (C): 123456789012345678901 +02 (C): This is 132 column mode, dark background. +03 (C): This is 132 column mode, dark background. +04 (C): This is 132 column mode, dark background. +05 (C): This is 132 column mode, dark background. +06 (C): This is 132 column mode, dark background. +07 (C): This is 132 column mode, dark background. +08 (C): This is 132 column mode, dark background. +09 (C): This is 132 column mode, dark background. +10 (C): This is 132 column mode, dark background. +11 (C): This is 132 column mode, dark background. +12 (C): This is 132 column mode, dark background. +13 (C): This is 132 column mode, dark background. +14 (C): This is 132 column mode, dark background. +15 (C): This is 132 column mode, dark background. +16 (C): This is 132 column mode, dark background. +17 (C): This is 132 column mode, dark background. +18 (C): This is 132 column mode, dark background. +19 (C): This is 132 column mode, dark background.Push <RETURN> +20 (C): +21 (C): + diff --git a/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_5.snap b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_5.snap new file mode 100644 index 00000000..2bcc2870 --- /dev/null +++ b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_5.snap @@ -0,0 +1,28 @@ +--- +source: src/client/panes/./unit/grid_tests.rs +expression: "format!(\"{:?}\", grid)" + +--- +00 (C): 1234567890123456789012345678901234567890123456789012345678901234567890123456789 +01 (C): +02 (C): This is 80 column mode, dark background. +03 (C): This is 80 column mode, dark background. +04 (C): This is 80 column mode, dark background. +05 (C): This is 80 column mode, dark background. +06 (C): This is 80 column mode, dark background. +07 (C): This is 80 column mode, dark background. +08 (C): This is 80 column mode, dark background. +09 (C): This is 80 column mode, dark background. +10 (C): This is 80 column mode, dark background. +11 (C): This is 80 column mode, dark background. +12 (C): This is 80 column mode, dark background. +13 (C): This is 80 column mode, dark background. +14 (C): This is 80 column mode, dark background. +15 (C): This is 80 column mode, dark background. +16 (C): This is 80 column mode, dark background. +17 (C): This is 80 column mode, dark background. +18 (C): This is 80 column mode, dark background. +19 (C): This is 80 column mode, dark background.Push <RETURN> +20 (C): +21 (C): + diff --git a/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_6.snap b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_6.snap new file mode 100644 index 00000000..360dc423 --- /dev/null +++ b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_6.snap @@ -0,0 +1,28 @@ +--- +source: src/client/panes/./unit/grid_tests.rs +expression: "format!(\"{:?}\", grid)" + +--- +00 (C): +01 (C): +02 (C): +03 (C): +04 (C): +05 (C): +06 (C): +07 (C): +08 (C): +09 (C): +10 (C): +11 (W): Push <RETURN> +12 (W): Soft scroll down region [12..13] size 2 Line 29 +13 (C): +14 (C): +15 (C): +16 (C): +17 (C): +18 (C): +19 (C): +20 (C): +21 (C): + diff --git a/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_7.snap b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_7.snap new file mode 100644 index 00000000..467ae258 --- /dev/null +++ b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_7.snap @@ -0,0 +1,30 @@ +--- +source: src/client/panes/./unit/grid_tests.rs +expression: "format!(\"{:?}\", grid)" + +--- +00 (W): Push <RETURN> +01 (W): Soft scroll down region [1..24] size 24 Line 29 +02 (W): Soft scroll down region [1..24] size 24 Line 28 +03 (W): Soft scroll down region [1..24] size 24 Line 27 +04 (W): Soft scroll down region [1..24] size 24 Line 26 +05 (W): Soft scroll down region [1..24] size 24 Line 25 +06 (W): Soft scroll down region [1..24] size 24 Line 24 +07 (W): Soft scroll down region [1..24] size 24 Line 23 +08 (W): Soft scroll down region [1..24] size 24 Line 22 +09 (W): Soft scroll down region [1..24] size 24 Line 21 +10 (W): Soft scroll down region [1..24] size 24 Line 20 +11 (W): Soft scroll down region [1..24] size 24 Line 19 +12 (W): Soft scroll down region [1..24] size 24 Line 18 +13 (W): Soft scroll down region [1..24] size 24 Line 17 +14 (W): Soft scroll down region [1..24] size 24 Line 16 +15 (W): Soft scroll down region [1..24] size 24 Line 15 +16 (W): Soft scroll down region [1..24] size 24 Line 14 +17 (W): Soft scroll down region [1..24] size 24 Line 13 +18 (W): Soft scroll down region [1..24] size 24 Line 12 +19 (W): Soft scroll down region [1..24] size 24 Line 11 +20 (W): Soft scroll down region [1..24] size 24 Line 10 +21 (W): Soft scroll down region [1..24] size 24 Line 9 +22 (W): Soft scroll down region [1..24] size 24 Line 8 +23 (W): Soft scroll down region [1..24] size 24 Line 7 + diff --git a/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_8.snap b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_8.snap new file mode 100644 index 00000000..f892edd2 --- /dev/null +++ b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_8.snap @@ -0,0 +1,30 @@ +--- +source: src/client/panes/./unit/grid_tests.rs +expression: "format!(\"{:?}\", grid)" + +--- +00 (W): +01 (W): +02 (W): +03 (W): +04 (W): +05 (W): +06 (W): +07 (W): +08 (W): +09 (W): +10 (W): +11 (W): Push <RETURN> +12 (W): Jump scroll down region [12..13] size 2 Line 29 +13 (W): +14 (W): +15 (W): +16 (W): +17 (W): +18 (W): +19 (W): +20 (W): +21 (W): +22 (W): +23 (W): + diff --git a/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_9.snap b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_9.snap new file mode 100644 index 00000000..63e46c04 --- /dev/null +++ b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_9.snap @@ -0,0 +1,30 @@ +--- +source: src/client/panes/./unit/grid_tests.rs +expression: "format!(\"{:?}\", grid)" + +--- +00 (W): Push <RETURN> +01 (W): Jump scroll down region [1..24] size 24 Line 29 +02 (W): Jump scroll down region [1..24] size 24 Line 28 +03 (W): Jump scroll down region [1..24] size 24 Line 27 +04 (W): Jump scroll down region [1..24] size 24 Line 26 +05 (W): Jump scroll down region [1..24] size 24 Line 25 +06 (W): Jump scroll down region [1..24] size 24 Line 24 +07 (W): Jump scroll down region [1..24] size 24 Line 23 +08 (W): Jump scroll down region [1..24] size 24 Line 22 +09 (W): Jump scroll down region [1..24] size 24 Line 21 +10 (W): Jump scroll down region [1..24] size 24 Line 20 +11 (W): Jump scroll down region [1..24] size 24 Line 19 +12 (W): Jump scroll down region [1..24] size 24 Line 18 +13 (W): Jump scroll down region [1..24] size 24 Line 17 +14 (W): Jump scroll down region [1..24] size 24 Line 16 +15 (W): Jump scroll down region [1..24] size 24 Line 15 +16 (W): Jump scroll down region [1..24] size 24 Line 14 +17 (W): Jump scroll down region [1..24] size 24 Line 13 +18 (W): Jump scroll down region [1..24] size 24 Line 12 +19 (W): Jump scroll down region [1..24] size 24 Line 11 +20 (W): Jump scroll down region [1..24] size 24 Line 10 +21 (W): Jump scroll down region [1..24] size 24 Line 9 +22 (W): Jump scroll down region [1..24] size 24 Line 8 +23 (W): Jump scroll down region [1..24] size 24 Line 7 + diff --git a/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest3_0.snap b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest3_0.snap new file mode 100644 index 00000000..42c6f634 --- /dev/null +++ b/src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest3_0.snap @@ -0,0 +1,30 @@ +--- +source: src/client/panes/./unit/grid_tests.rs +expression: "format!(\"{:?}\", grid)" + +--- +00 (C): Selected as G0 (with SI) Selected as G1 (with SO) +01 (C): +02 (C): Character set B (US ASCII) +03 (C): !"#$%&'()*+,-./0123456789:;<=>? !"#$%&'()*+,-./0123456789:;<=>? +04 (C): @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ +05 (C): `abcdefghijklmnopqrstuvwxyz{|}~ `abcdefghijklmnopqrstuvwxyz{|}~ +06 (C): Character set A (British) +07 (C): !"#$%&'()*+,-./0123456789:;<=>? !"#$%&'()*+,-./0123456789:;<=>? +08 (C): @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ +09 (C): `abcdefghijklmnopqrstuvwxyz{|}~ `abcdefghijklmnopqrstuvwxyz{|}~ +10 (C): Character set 0 (DEC Special graphics and line drawing) +11 (C): !"#$%&'()*+,-./0123456789:;<=>? !"#$%&'()*+,-./0123456789:;<=>? +12 (C): @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ +13 (C): ◆▒␉␌␍␊°±␋┘┐┌└┼⎺⎻─⎼⎽├┤┴┬│≤≥π≠£· ◆▒␉␌␍␊°±␋┘┐┌└┼⎺⎻─⎼⎽├┤┴┬│≤≥π≠£· +14 (C): Character set 1 (DEC Alternate character ROM standard characters) +15 (C): !"#$%&'()*+,-./0123456789:;<=>? !"#$%&'()*+,-./0123456789:;<=>? +16 (C): @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ +17 (C): `abcdefghijklmnopqrstuvwxyz{|}~ `abcdefghijklmnopqrstuvwxyz{|}~ +18 (C): Character set 2 (DEC Alternate character ROM special graphics) +19 (C): !"#$%&'()*+,-./0123456789:;<=>? !"#$%&'()*+,-./0123456789:;<=>? +20 (C): @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ +21 (C): `abcdefghijklmnopqrstuvwxyz{|}~ `abcdefghijklmnopqrstuvwxyz{|}~ +22 (C): +23 (C): These are the installed character sets. Push <RETURN> + |
