pub struct Term {
pub dirty: bool,
pub visual_bell: VisualBell,
pub next_is_urgent: Option<bool>,
/* private fields */
}
Fields§
§dirty: bool
§visual_bell: VisualBell
§next_is_urgent: Option<bool>
Implementations§
Source§impl Term
impl Term
pub fn selection(&self) -> &Option<Selection>
pub fn selection_mut(&mut self) -> &mut Option<Selection>
pub fn get_next_title(&mut self) -> Option<String>
pub fn scroll_display(&mut self, scroll: Scroll)
pub fn get_next_mouse_cursor(&mut self) -> Option<MouseCursor>
pub fn new(size: SizeInfo) -> Term
pub fn needs_draw(&self) -> bool
pub fn selection_to_string(&self) -> Option<String>
Sourcepub fn pixels_to_coords(&self, x: usize, y: usize) -> Option<Point>
pub fn pixels_to_coords(&self, x: usize, y: usize) -> Option<Point>
Convert the given pixel values to a grid coordinate
The mouse coordinates are expected to be relative to the top left. The line and column returned are also relative to the top left.
Returns None if the coordinates are outside the screen
Sourcepub fn grid(&self) -> &Grid<Cell>
pub fn grid(&self) -> &Grid<Cell>
Access to the raw grid data structure
This is a bit of a hack; when the window is closed, the event processor serializes the grid state to a file.
Sourcepub fn renderable_cells(&self) -> RenderableCellsIter<'_> ⓘ
pub fn renderable_cells(&self) -> RenderableCellsIter<'_> ⓘ
Iterate over the renderable cells in the terminal
A renderable cell is any cell which has content other than the default background color. Cells with an alternate background color are considered renderable as are cells with any text content.
pub fn size_info(&self) -> &SizeInfo
pub fn mode(&self) -> &TermMode
pub fn cursor(&self) -> &Cursor
pub fn swap_alt(&mut self)
pub fn exit(&mut self)
pub fn should_exit(&self) -> bool
Trait Implementations§
Source§impl Dimensions for Term
impl Dimensions for Term
Source§fn dimensions(&self) -> Point
fn dimensions(&self) -> Point
Source§impl Handler for Term
impl Handler for Term
Source§fn set_mouse_cursor(&mut self, cursor: MouseCursor)
fn set_mouse_cursor(&mut self, cursor: MouseCursor)
Set the mouse cursor
Source§fn carriage_return(&mut self)
fn carriage_return(&mut self)
Carriage return
Source§fn newline(&mut self)
fn newline(&mut self)
Run LF/NL
LF/NL mode has some interesting history. According to ECMA-48 4th edition, in LINE FEED mode,
The execution of the formatter functions LINE FEED (LF), FORM FEED (FF), LINE TABULATION (VT) cause only movement of the active position in the direction of the line progression.
In NEW LINE mode,
The execution of the formatter functions LINE FEED (LF), FORM FEED (FF), LINE TABULATION (VT) cause movement to the line home position on the following line, the following form, etc. In the case of LF this is referred to as the New index::Line (NL) option.
Additionally, ECMA-48 4th edition says that this option is deprecated. ECMA-48 5th edition only mentions this option (without explanation) saying that it’s been removed.
As an emulator, we need to support it since applications may still rely on it.
Source§fn terminal_attribute(&mut self, attr: Attr)
fn terminal_attribute(&mut self, attr: Attr)
set a terminal attribute
Source§fn set_clipboard(&mut self, _string: &str)
fn set_clipboard(&mut self, _string: &str)
Set the clipboard
Source§fn set_cursor_style(&mut self, style: Option<CursorStyle>)
fn set_cursor_style(&mut self, style: Option<CursorStyle>)
Source§fn insert_blank(&mut self, count: Column)
fn insert_blank(&mut self, count: Column)
Source§fn identify_terminal<W: Write>(&mut self, writer: &mut W)
fn identify_terminal<W: Write>(&mut self, writer: &mut W)
fn device_status<W: Write>(&mut self, writer: &mut W, arg: usize)
Source§fn move_forward(&mut self, cols: Column)
fn move_forward(&mut self, cols: Column)
cols
Source§fn move_backward(&mut self, cols: Column)
fn move_backward(&mut self, cols: Column)
cols
Source§fn move_down_and_cr(&mut self, lines: Line)
fn move_down_and_cr(&mut self, lines: Line)
rows
and set to column 1Source§fn move_up_and_cr(&mut self, lines: Line)
fn move_up_and_cr(&mut self, lines: Line)
rows
and set to column 1Source§fn substitute(&mut self)
fn substitute(&mut self)
Source§fn set_horizontal_tabstop(&mut self)
fn set_horizontal_tabstop(&mut self)
Source§fn scroll_down(&mut self, lines: Line)
fn scroll_down(&mut self, lines: Line)
rows
rowsSource§fn insert_blank_lines(&mut self, lines: Line)
fn insert_blank_lines(&mut self, lines: Line)
count
blank linesSource§fn delete_lines(&mut self, lines: Line)
fn delete_lines(&mut self, lines: Line)
count
linesSource§fn erase_chars(&mut self, count: Column)
fn erase_chars(&mut self, count: Column)
count
chars in current line following cursor Read moreSource§fn delete_chars(&mut self, count: Column)
fn delete_chars(&mut self, count: Column)
count
chars Read moreSource§fn move_backward_tabs(&mut self, count: i64)
fn move_backward_tabs(&mut self, count: i64)
count
tabsSource§fn move_forward_tabs(&mut self, count: i64)
fn move_forward_tabs(&mut self, count: i64)
count
tabs