#[macro_use]
#[path = "support/mod.rs"]
mod support;
use shpool_vterm::{term, ContentRegion};
use smallvec::smallvec;
frag! {
cursor_left { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCodes::cursor_backwards(1),
term::Raw::from("B")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("B"),
term::ControlCodes::cursor_position(1, 2),
term::control_codes().clear_attrs
}
frag! {
cursor_left_multi { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("ABC"),
term::ControlCodes::cursor_backwards(2),
term::Raw::from("X")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::Raw::from("X"),
term::Raw::from("C"),
term::ControlCodes::cursor_position(1, 3),
term::control_codes().clear_attrs
}
frag! {
cursor_right_gap { scrollback_lines: 100, width: 10, height: 10 }
<= term::control_codes().inverse,
term::Raw::from("A"),
term::ControlCodes::cursor_backwards(1),
term::Raw::from("B"),
term::ControlCodes::cursor_forward(1),
term::Raw::from("C"),
term::control_codes().undo_inverse
=> ContentRegion::All =>
reset_codes,
term::control_codes().inverse,
term::Raw::from("B"),
term::control_codes().undo_inverse,
term::Raw::from(" "),
term::control_codes().inverse,
term::Raw::from("C"),
term::control_codes().undo_inverse,
term::ControlCodes::cursor_position(1, 4),
term::control_codes().clear_attrs
}
frag! {
cursor_right_multi { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCodes::cursor_forward(2),
term::Raw::from("B")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::Raw::from(" "),
term::Raw::from(" "),
term::Raw::from("B"),
term::ControlCodes::cursor_position(1, 5),
term::control_codes().clear_attrs
}
frag! {
cursor_down { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCodes::cursor_down(1),
term::ControlCodes::cursor_backwards(1),
term::Raw::from("B")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::Crlf::default(),
term::Raw::from("B"),
term::ControlCodes::cursor_position(2, 2),
term::control_codes().clear_attrs
}
frag! {
cursor_down_multi { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCodes::cursor_down(2),
term::ControlCodes::cursor_backwards(1),
term::Raw::from("B")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::Crlf::default(),
term::Crlf::default(),
term::Raw::from("B"),
term::ControlCodes::cursor_position(3, 2),
term::control_codes().clear_attrs
}
frag! {
cursor_up { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::Crlf::default(),
term::Raw::from("B"),
term::ControlCodes::cursor_up(1),
term::Raw::from("C")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::Raw::from("C"),
term::Crlf::default(),
term::Raw::from("B"),
term::ControlCodes::cursor_position(1, 3),
term::control_codes().clear_attrs
}
frag! {
cursor_up_multi { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::Crlf::default(),
term::Crlf::default(),
term::Raw::from("B"),
term::ControlCodes::cursor_up(2),
term::Raw::from("C")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::Raw::from("C"),
term::Crlf::default(),
term::Crlf::default(),
term::Raw::from("B"),
term::ControlCodes::cursor_position(1, 3),
term::control_codes().clear_attrs
}
frag! {
cursor_next_line { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCodes::cursor_next_line(1),
term::Raw::from("B")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::Crlf::default(),
term::Raw::from("B"),
term::ControlCodes::cursor_position(2, 2),
term::control_codes().clear_attrs
}
frag! {
cursor_next_line_multi { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCodes::cursor_next_line(2),
term::Raw::from("B")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::Crlf::default(),
term::Crlf::default(),
term::Raw::from("B"),
term::ControlCodes::cursor_position(3, 2),
term::control_codes().clear_attrs
}
frag! {
cursor_prev_line { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::Crlf::default(),
term::Raw::from("B"),
term::ControlCodes::cursor_prev_line(1),
term::Raw::from("C")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("C"),
term::Crlf::default(),
term::Raw::from("B"),
term::ControlCodes::cursor_position(1, 2),
term::control_codes().clear_attrs
}
frag! {
cursor_prev_line_multi { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::Crlf::default(),
term::Crlf::default(),
term::Raw::from("B"),
term::ControlCodes::cursor_prev_line(2),
term::Raw::from("C")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("C"),
term::Crlf::default(),
term::Crlf::default(),
term::Raw::from("B"),
term::ControlCodes::cursor_position(1, 2),
term::control_codes().clear_attrs
}
frag! {
cursor_position { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCodes::cursor_position(3, 3),
term::Raw::from("B")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::Crlf::default(),
term::Crlf::default(),
term::Raw::from(" B"),
term::ControlCodes::cursor_position(3, 4),
term::control_codes().clear_attrs
}
frag! {
horizontal_and_vertical_position { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCodes::horizontal_and_vertical_position(3, 3),
term::Raw::from("B")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::Crlf::default(),
term::Crlf::default(),
term::Raw::from(" B"),
term::ControlCodes::cursor_position(3, 4),
term::control_codes().clear_attrs
}
frag! {
scp_rcp { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::control_codes().save_cursor_position,
term::Crlf::default(),
term::Raw::from("B"),
term::control_codes().restore_cursor_position,
term::Raw::from("C")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("AC"),
term::Crlf::default(),
term::Raw::from("B"),
term::ControlCodes::cursor_position(1, 3),
term::control_codes().clear_attrs
}
frag! {
cursor_horizontal_absolute { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCodes::cursor_horizontal_absolute(3),
term::Raw::from("B")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::Raw::from(" "),
term::Raw::from("B"),
term::ControlCodes::cursor_position(1, 4),
term::control_codes().clear_attrs
}
frag! {
horizontal_position_absolute { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCodes::horizontal_position_absolute(3),
term::Raw::from("B")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::Raw::from(" "),
term::Raw::from("B"),
term::ControlCodes::cursor_position(1, 4),
term::control_codes().clear_attrs
}
frag! {
vertical_position_absolute { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCodes::vertical_position_absolute(3),
term::Raw::from("B")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::Crlf::default(),
term::Crlf::default(),
term::Raw::from(" B"),
term::ControlCodes::cursor_position(3, 3),
term::control_codes().clear_attrs
}
frag! {
vertical_position_absolute_default_one { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::Crlf::default(),
term::Raw::from("B"),
term::ControlCode::CSI {
params: smallvec![],
intermediates: smallvec![],
action: 'd',
},
term::Raw::from("X")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("AX"),
term::Crlf::default(),
term::Raw::from("B"),
term::ControlCodes::cursor_position(1, 3),
term::control_codes().clear_attrs
}
frag! {
vertical_position_absolute_origin_mode { scrollback_lines: 100, width: 4, height: 4 }
<= term::ControlCodes::set_scroll_region(2, 4),
term::control_codes().enable_scroll_region_origin_mode,
term::ControlCodes::vertical_position_absolute(2),
term::Raw::from("X"),
term::control_codes().disable_scroll_region_origin_mode
=> ContentRegion::All =>
reset_codes,
term::Crlf::default(),
term::Crlf::default(),
term::Raw::from("X"),
term::ControlCodes::set_scroll_region(2, 4),
term::ControlCodes::cursor_position(3, 2),
term::control_codes().clear_attrs
}
frag! {
cursor_position_no_params { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("123"),
term::ControlCode::CSI {
params: smallvec![],
intermediates: smallvec![],
action: 'H',
},
term::Raw::from("X")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("X23"),
term::ControlCodes::cursor_position(1, 2),
term::control_codes().clear_attrs
}
frag! {
scroll_up { scrollback_lines: 100, width: 10, height: 2 }
<= term::Raw::from("A"),
term::Crlf::default(),
term::Raw::from("B"),
term::Crlf::default(),
term::Raw::from("C"),
term::ControlCodes::scroll_up(1)
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::Crlf::default(),
term::Raw::from("B"),
term::Crlf::default(),
term::Raw::from("C"),
term::ControlCodes::scroll_up(1),
term::ControlCodes::cursor_position(2, 2),
term::control_codes().clear_attrs
=> ContentRegion::BottomLines(50) =>
reset_codes,
term::Raw::from("A"),
term::Crlf::default(),
term::Raw::from("B"),
term::Crlf::default(),
term::Raw::from("C"),
term::ControlCodes::scroll_up(1),
term::ControlCodes::cursor_position(2, 2),
term::control_codes().clear_attrs
=> ContentRegion::Screen =>
reset_codes,
term::Raw::from("A"),
term::Crlf::default(),
term::Raw::from("B"),
term::ControlCodes::cursor_position(2, 2),
term::control_codes().clear_attrs
}
frag! {
scroll_down { scrollback_lines: 100, width: 10, height: 2 }
<= term::Raw::from("A\n\rB\n\rC\n\rD"),
term::ControlCodes::scroll_up(2),
term::ControlCodes::scroll_down(1)
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::Crlf::default(),
term::Raw::from("B"),
term::Crlf::default(),
term::Raw::from("C"),
term::Crlf::default(),
term::Raw::from("D"),
term::ControlCodes::scroll_up(1),
term::ControlCodes::cursor_position(2, 2),
term::control_codes().clear_attrs
=> ContentRegion::BottomLines(50) =>
reset_codes,
term::Raw::from("A"),
term::Crlf::default(),
term::Raw::from("B"),
term::Crlf::default(),
term::Raw::from("C"),
term::Crlf::default(),
term::Raw::from("D"),
term::ControlCodes::scroll_up(1),
term::ControlCodes::cursor_position(2, 2),
term::control_codes().clear_attrs
=> ContentRegion::Screen =>
reset_codes,
term::Raw::from("B"),
term::Crlf::default(),
term::Raw::from("C"),
term::ControlCodes::cursor_position(2, 2),
term::control_codes().clear_attrs
}
frag! {
scroll_region { scrollback_lines: 100, width: 10, height: 10 }
<= term::ControlCodes::set_scroll_region(2, 5)
=> ContentRegion::All =>
reset_codes,
term::ControlCodes::set_scroll_region(2, 5),
term::ControlCodes::cursor_position(1, 1),
term::control_codes().clear_attrs
}
frag! {
scroll_region_with_content { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCodes::set_scroll_region(2, 5)
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::ControlCodes::set_scroll_region(2, 5),
term::ControlCodes::cursor_position(1, 2),
term::control_codes().clear_attrs
}
frag! {
scroll_region_unset { scrollback_lines: 100, width: 10, height: 10 }
<= term::ControlCodes::set_scroll_region(2, 5),
term::control_codes().unset_scroll_region
=> ContentRegion::All =>
reset_codes,
term::ControlCodes::cursor_position(1, 1),
term::control_codes().clear_attrs
}
frag! {
origin_mode_clamp_top { scrollback_lines: 100, width: 4, height: 4 }
<= term::ControlCodes::set_scroll_region(2, 3),
term::control_codes().enable_scroll_region_origin_mode,
term::ControlCodes::cursor_position(1, 1),
term::ControlCodes::cursor_up(1),
term::control_codes().disable_scroll_region_origin_mode
=> ContentRegion::All =>
reset_codes,
term::ControlCodes::set_scroll_region(2, 3),
term::ControlCodes::cursor_position(2, 1),
term::control_codes().clear_attrs
}
frag! {
origin_mode_clamp_bottom { scrollback_lines: 100, width: 4, height: 4 }
<= term::ControlCodes::set_scroll_region(2, 3),
term::control_codes().enable_scroll_region_origin_mode,
term::ControlCodes::cursor_position(2, 1),
term::ControlCodes::cursor_down(1),
term::control_codes().disable_scroll_region_origin_mode
=> ContentRegion::All =>
reset_codes,
term::ControlCodes::set_scroll_region(2, 3),
term::ControlCodes::cursor_position(3, 1),
term::control_codes().clear_attrs
}
frag! {
origin_mode_cup_translation { scrollback_lines: 4, width: 4, height: 4 }
<= term::ControlCodes::set_scroll_region(2, 3),
term::control_codes().enable_scroll_region_origin_mode,
term::ControlCodes::cursor_position(2, 2),
term::Raw::from("X"),
term::control_codes().disable_scroll_region_origin_mode
=> ContentRegion::All =>
reset_codes,
term::Crlf::default(),
term::Crlf::default(),
term::Raw::from(" X"),
term::ControlCodes::set_scroll_region(2, 3),
term::ControlCodes::cursor_position(3, 3),
term::control_codes().clear_attrs
}
frag! {
origin_mode_sets_bit { scrollback_lines: 4, width: 4, height: 4 }
<= term::ControlCodes::set_scroll_region(2, 3),
term::control_codes().enable_scroll_region_origin_mode,
term::ControlCodes::cursor_position(2, 2),
term::Raw::from("X")
=> ContentRegion::All =>
reset_codes,
term::Crlf::default(),
term::Crlf::default(),
term::Raw::from(" X"),
term::ControlCodes::set_scroll_region(2, 3),
term::ControlCodes::cursor_position(3, 3),
term::control_codes().enable_scroll_region_origin_mode,
term::control_codes().clear_attrs
}
frag! {
origin_mode_cup_clamp { scrollback_lines: 4, width: 4, height: 4 }
<= term::ControlCodes::set_scroll_region(2, 3),
term::control_codes().enable_scroll_region_origin_mode,
term::ControlCodes::cursor_position(1000, 2),
term::Raw::from("X"),
term::control_codes().disable_scroll_region_origin_mode
=> ContentRegion::All =>
reset_codes,
term::Crlf::default(),
term::Crlf::default(),
term::Raw::from(" X"),
term::ControlCodes::set_scroll_region(2, 3),
term::ControlCodes::cursor_position(3, 3),
term::control_codes().clear_attrs
}
frag! {
backspace { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::Raw::from("\x08"),
term::Raw::from("B")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("B"),
term::ControlCodes::cursor_position(1, 2),
term::control_codes().clear_attrs
}
frag! {
backspace_saturate { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("\x08"),
term::Raw::from("A")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::ControlCodes::cursor_position(1, 2),
term::control_codes().clear_attrs
}
frag! {
scrollback_scroll_region_on_newline { scrollback_lines: 100, width: 5, height: 5 }
<= term::Raw::from("0"), term::Crlf::default(),
term::Raw::from("1"), term::Crlf::default(),
term::Raw::from("2"), term::Crlf::default(),
term::Raw::from("3"), term::Crlf::default(),
term::Raw::from("4"),
term::ControlCodes::set_scroll_region(2, 4),
term::ControlCodes::cursor_position(4, 1),
term::Raw::from("\n"),
term::Raw::from("X")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("0"),
term::Crlf::default(),
term::Raw::from("2"),
term::Crlf::default(),
term::Raw::from("3"),
term::Crlf::default(),
term::Raw::from("X"),
term::Crlf::default(),
term::Raw::from("4"),
term::ControlCodes::set_scroll_region(2, 4),
term::ControlCodes::cursor_position(4, 2),
term::control_codes().clear_attrs
}
frag! {
scrollback_newline_below_scroll_region { scrollback_lines: 100, width: 5, height: 5 }
<= term::Raw::from("0"), term::Crlf::default(),
term::Raw::from("1"), term::Crlf::default(),
term::Raw::from("2"), term::Crlf::default(),
term::Raw::from("3"), term::Crlf::default(),
term::Raw::from("4"),
term::ControlCodes::set_scroll_region(2, 4),
term::ControlCodes::cursor_position(5, 1),
term::Raw::from("\n"),
term::Raw::from("X")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("0"),
term::Crlf::default(),
term::Raw::from("1"),
term::Crlf::default(),
term::Raw::from("2"),
term::Crlf::default(),
term::Raw::from("3"),
term::Crlf::default(),
term::Raw::from("X"),
term::ControlCodes::set_scroll_region(2, 4),
term::ControlCodes::cursor_position(5, 2),
term::control_codes().clear_attrs
}
frag! {
scrollback_newline_above_scroll_region { scrollback_lines: 100, width: 5, height: 5 }
<= term::Raw::from("0"), term::Crlf::default(),
term::Raw::from("1"), term::Crlf::default(),
term::Raw::from("2"), term::Crlf::default(),
term::Raw::from("3"), term::Crlf::default(),
term::Raw::from("4"),
term::ControlCodes::set_scroll_region(2, 4),
term::ControlCodes::cursor_position(1, 1),
term::Raw::from("\n"),
term::Raw::from("X")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("0"),
term::Crlf::default(),
term::Raw::from("X"),
term::Crlf::default(),
term::Raw::from("2"),
term::Crlf::default(),
term::Raw::from("3"),
term::Crlf::default(),
term::Raw::from("4"),
term::ControlCodes::set_scroll_region(2, 4),
term::ControlCodes::cursor_position(2, 2),
term::control_codes().clear_attrs
}
frag! {
repeat_character_basic { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCodes::repeat_character(3)
=> ContentRegion::All =>
reset_codes,
term::Raw::from("AAAA"),
term::ControlCodes::cursor_position(1, 5),
term::control_codes().clear_attrs
}
frag! {
repeat_character_default_one { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCodes::repeat_character(1)
=> ContentRegion::All =>
reset_codes,
term::Raw::from("AA"),
term::ControlCodes::cursor_position(1, 3),
term::control_codes().clear_attrs
}
frag! {
repeat_character_consecutive { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCodes::repeat_character(2),
term::ControlCodes::repeat_character(1)
=> ContentRegion::All =>
reset_codes,
term::Raw::from("AAAA"),
term::ControlCodes::cursor_position(1, 5),
term::control_codes().clear_attrs
}
frag! {
repeat_character_reset_on_newline { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A\n"),
term::ControlCodes::repeat_character(3)
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::ControlCodes::cursor_position(2, 2),
term::control_codes().clear_attrs
}
frag! {
repeat_character_reset_on_carriage_return { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("ABC\r"),
term::ControlCodes::repeat_character(2)
=> ContentRegion::All =>
reset_codes,
term::Raw::from("ABC"),
term::ControlCodes::cursor_position(1, 1),
term::control_codes().clear_attrs
}
frag! {
repeat_character_reset_on_backspace { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("AB\x08"),
term::ControlCodes::repeat_character(2)
=> ContentRegion::All =>
reset_codes,
term::Raw::from("AB"),
term::ControlCodes::cursor_position(1, 2),
term::control_codes().clear_attrs
}
frag! {
repeat_character_reset_on_tab { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A\t"),
term::ControlCodes::repeat_character(2)
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::ControlCodes::cursor_position(1, 9),
term::control_codes().clear_attrs
}
frag! {
repeat_character_reset_on_cursor_move { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCodes::cursor_forward(2),
term::ControlCodes::repeat_character(3)
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::ControlCodes::cursor_position(1, 4),
term::control_codes().clear_attrs
}
frag! {
repeat_character_reset_on_csi_with_intermediates { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCode::CSI { params: smallvec![smallvec![3]], intermediates: smallvec![b'?'], action: 'b' },
term::ControlCodes::repeat_character(3)
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::ControlCodes::cursor_position(1, 2),
term::control_codes().clear_attrs
}
frag! {
repeat_character_reset_on_esc { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::control_codes().save_cursor,
term::ControlCodes::repeat_character(3)
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::ControlCodes::cursor_position(1, 2),
term::control_codes().clear_attrs
}
frag! {
repeat_character_reset_on_osc { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::ControlCodes::set_title(smallvec![b't']),
term::ControlCodes::repeat_character(3)
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::ControlCodes::cursor_position(1, 2),
term::control_codes().clear_attrs,
term::ControlCodes::set_title(smallvec![b't'])
}
frag! {
repeat_character_reset_on_dcs_hook { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A\x1bP+q\x1b\\"),
term::ControlCodes::repeat_character(3)
=> ContentRegion::All =>
reset_codes,
term::Raw::from("A"),
term::ControlCodes::cursor_position(1, 2),
term::control_codes().clear_attrs
}
frag! {
reverse_index_basic { scrollback_lines: 100, width: 10, height: 10 }
<= term::Raw::from("A"),
term::Crlf::default(),
term::Raw::from("B"),
term::control_codes().reverse_index,
term::Raw::from("C")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("AC"),
term::Crlf::default(),
term::Raw::from("B"),
term::ControlCodes::cursor_position(1, 3),
term::control_codes().clear_attrs
}
frag! {
reverse_index_scroll_at_top { scrollback_lines: 100, width: 5, height: 3 }
<= term::Raw::from("1"), term::Crlf::default(),
term::Raw::from("2"), term::Crlf::default(),
term::Raw::from("3"),
term::ControlCodes::cursor_position(1, 1),
term::control_codes().reverse_index,
term::Raw::from("X")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("X"),
term::Crlf::default(),
term::Raw::from("1"),
term::Crlf::default(),
term::Raw::from("2"),
term::ControlCodes::cursor_position(1, 2),
term::control_codes().clear_attrs
}
frag! {
reverse_index_scroll_region { scrollback_lines: 100, width: 5, height: 5 }
<= term::Raw::from("0"), term::Crlf::default(),
term::Raw::from("1"), term::Crlf::default(),
term::Raw::from("2"), term::Crlf::default(),
term::Raw::from("3"), term::Crlf::default(),
term::Raw::from("4"),
term::ControlCodes::set_scroll_region(2, 4),
term::ControlCodes::cursor_position(2, 1),
term::control_codes().reverse_index,
term::Raw::from("X")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("0"),
term::Crlf::default(),
term::Raw::from("X"),
term::Crlf::default(),
term::Raw::from("1"),
term::Crlf::default(),
term::Raw::from("2"),
term::Crlf::default(),
term::Raw::from("4"),
term::ControlCodes::set_scroll_region(2, 4),
term::ControlCodes::cursor_position(2, 2),
term::control_codes().clear_attrs
}
frag! {
reverse_index_above_scroll_region { scrollback_lines: 100, width: 5, height: 5 }
<= term::Raw::from("0"), term::Crlf::default(),
term::Raw::from("1"), term::Crlf::default(),
term::Raw::from("2"),
term::ControlCodes::set_scroll_region(3, 5),
term::ControlCodes::cursor_position(2, 1),
term::control_codes().reverse_index,
term::Raw::from("X")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("X"),
term::Crlf::default(),
term::Raw::from("1"),
term::Crlf::default(),
term::Raw::from("2"),
term::ControlCodes::set_scroll_region(3, 5),
term::ControlCodes::cursor_position(1, 2),
term::control_codes().clear_attrs
}
frag! {
reverse_index_clamp_top_outside_scroll_region { scrollback_lines: 100, width: 5, height: 5 }
<= term::Raw::from("A"),
term::ControlCodes::set_scroll_region(3, 5),
term::ControlCodes::cursor_position(1, 1),
term::control_codes().reverse_index,
term::Raw::from("B")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("B"),
term::ControlCodes::set_scroll_region(3, 5),
term::ControlCodes::cursor_position(1, 2),
term::control_codes().clear_attrs
}
frag! {
reverse_index_below_scroll_region { scrollback_lines: 100, width: 5, height: 5 }
<= term::Raw::from("0"), term::Crlf::default(),
term::Raw::from("1"), term::Crlf::default(),
term::Raw::from("2"), term::Crlf::default(),
term::Raw::from("3"),
term::ControlCodes::set_scroll_region(1, 3),
term::ControlCodes::cursor_position(4, 1),
term::control_codes().reverse_index,
term::Raw::from("X")
=> ContentRegion::All =>
reset_codes,
term::Raw::from("0"),
term::Crlf::default(),
term::Raw::from("1"),
term::Crlf::default(),
term::Raw::from("X"),
term::Crlf::default(),
term::Raw::from("3"),
term::ControlCodes::set_scroll_region(1, 3),
term::ControlCodes::cursor_position(3, 2),
term::control_codes().clear_attrs
}