pub struct Term<T> {
pub is_focused: bool,
pub dirty: bool,
pub visual_bell: VisualBell,
/* private fields */
}
Fields§
§is_focused: bool
Terminal focus
dirty: bool
§visual_bell: VisualBell
Implementations§
Source§impl<T> Term<T>
impl<T> Term<T>
pub fn selection(&self) -> &Option<Selection>
pub fn selection_mut(&mut self) -> &mut Option<Selection>
pub fn scroll_display(&mut self, scroll: Scroll)where
T: EventListener,
pub fn new<C>( config: &Config<C>, size: &SizeInfo, clipboard: Clipboard, event_proxy: T, ) -> Term<T>
pub fn update_config<C>(&mut self, config: &Config<C>)
Sourcepub fn selection_to_string(&self) -> Option<String>
pub fn selection_to_string(&self) -> Option<String>
Convert the active selection to a String.
Sourcepub fn bounds_to_string(&self, start: Point<usize>, end: Point<usize>) -> String
pub fn bounds_to_string(&self, start: Point<usize>, end: Point<usize>) -> String
Convert range between two points to a String.
pub fn visible_to_buffer(&self, point: Point) -> Point<usize>
pub fn buffer_to_visible( &self, point: impl Into<Point<usize>>, ) -> Option<Point<usize>>
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<'b, C>(
&'b self,
config: &'b Config<C>,
) -> RenderableCellsIter<'_, C> ⓘ
pub fn renderable_cells<'b, C>( &'b self, config: &'b Config<C>, ) -> RenderableCellsIter<'_, C> ⓘ
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 mode(&self) -> &TermMode
pub fn cursor(&self) -> &Cursor
pub fn swap_alt(&mut self)
pub fn background_color(&self) -> Rgb
pub fn exit(&mut self)where
T: EventListener,
pub fn clipboard(&mut self) -> &mut Clipboard
Trait Implementations§
Source§impl<T: EventListener> Handler for Term<T>
impl<T: EventListener> Handler for Term<T>
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 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 dynamic_color_sequence<W: Write>(
&mut self,
writer: &mut W,
code: u8,
index: usize,
)
fn dynamic_color_sequence<W: Write>( &mut self, writer: &mut W, code: u8, index: usize, )
Write a foreground/background color escape sequence with the current color
Source§fn reset_color(&mut self, index: usize)
fn reset_color(&mut self, index: usize)
Reset the indexed color to original value
Source§fn set_clipboard(&mut self, clipboard: u8, base64: &[u8])
fn set_clipboard(&mut self, clipboard: u8, base64: &[u8])
Set the clipboard
Source§fn write_clipboard<W: Write>(&mut self, clipboard: u8, writer: &mut W)
fn write_clipboard<W: Write>(&mut self, clipboard: u8, writer: &mut W)
Write clipboard data to child.
Source§fn terminal_attribute(&mut self, attr: Attr)
fn terminal_attribute(&mut self, attr: Attr)
set a terminal attribute
Source§fn insert_blank(&mut self, count: Column)
fn insert_blank(&mut self, count: Column)
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 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_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