Struct alacritty_terminal::term::Term
source · pub struct Term<T> {
pub is_focused: bool,
pub vi_mode_cursor: ViModeCursor,
pub selection: Option<Selection>,
/* private fields */
}
Fields§
§is_focused: bool
Terminal focus controlling the cursor shape.
vi_mode_cursor: ViModeCursor
Cursor for keyboard selection.
selection: Option<Selection>
Implementations§
source§impl<T> Term<T>
impl<T> Term<T>
sourcepub fn search_next(
&self,
regex: &mut RegexSearch,
origin: Point,
direction: Direction,
side: Side,
max_lines: Option<usize>
) -> Option<Match>
pub fn search_next( &self, regex: &mut RegexSearch, origin: Point, direction: Direction, side: Side, max_lines: Option<usize> ) -> Option<Match>
Get next search match in the specified direction.
sourcepub fn regex_search_left(
&self,
regex: &mut RegexSearch,
start: Point,
end: Point
) -> Option<Match>
pub fn regex_search_left( &self, regex: &mut RegexSearch, start: Point, end: Point ) -> Option<Match>
Find the next regex match to the left of the origin point.
The origin is always included in the regex.
sourcepub fn regex_search_right(
&self,
regex: &mut RegexSearch,
start: Point,
end: Point
) -> Option<Match>
pub fn regex_search_right( &self, regex: &mut RegexSearch, start: Point, end: Point ) -> Option<Match>
Find the next regex match to the right of the origin point.
The origin is always included in the regex.
sourcepub fn bracket_search(&self, point: Point) -> Option<Point>
pub fn bracket_search(&self, point: Point) -> Option<Point>
Find next matching bracket.
sourcepub fn semantic_search_left(&self, point: Point) -> Point
pub fn semantic_search_left(&self, point: Point) -> Point
Find left end of semantic block.
sourcepub fn semantic_search_right(&self, point: Point) -> Point
pub fn semantic_search_right(&self, point: Point) -> Point
Find right end of semantic block.
sourcepub fn inline_search_left(
&self,
point: Point,
needles: &str
) -> Result<Point, Point>
pub fn inline_search_left( &self, point: Point, needles: &str ) -> Result<Point, Point>
Searching to the left, find the next character contained in needles
.
sourcepub fn inline_search_right(
&self,
point: Point,
needles: &str
) -> Result<Point, Point>
pub fn inline_search_right( &self, point: Point, needles: &str ) -> Result<Point, Point>
Searching to the right, find the next character contained in needles
.
sourcepub fn line_search_left(&self, point: Point) -> Point
pub fn line_search_left(&self, point: Point) -> Point
Find the beginning of the current line across linewraps.
sourcepub fn line_search_right(&self, point: Point) -> Point
pub fn line_search_right(&self, point: Point) -> Point
Find the end of the current line across linewraps.
source§impl<T> Term<T>
impl<T> Term<T>
pub fn scroll_display(&mut self, scroll: Scroll)where
T: EventListener,
pub fn new<D: Dimensions>( config: Config, dimensions: &D, event_proxy: T ) -> Term<T>
sourcepub fn damage(&mut self) -> TermDamage<'_>
pub fn damage(&mut self) -> TermDamage<'_>
Collect the information about the changes in the lines, which could be used to minimize the amount of drawing operations.
The user controlled elements, like Vi
mode cursor and Selection
are not part of the
collected damage state. Those could easily be tracked by comparing their old and new
value between adjacent frames.
After reading damage reset_damage
should be called.
sourcepub fn reset_damage(&mut self)
pub fn reset_damage(&mut self)
Resets the terminal damage information.
sourcepub fn set_options(&mut self, options: Config)where
T: EventListener,
pub fn set_options(&mut self, options: Config)where
T: EventListener,
Set new options for the Term
.
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, end: Point) -> String
pub fn bounds_to_string(&self, start: Point, end: Point) -> String
Convert range between two points to a String.
sourcepub fn renderable_content(&self) -> RenderableContent<'_>where
T: EventListener,
pub fn renderable_content(&self) -> RenderableContent<'_>where
T: EventListener,
Terminal content required for rendering.
sourcepub fn resize<S: Dimensions>(&mut self, size: S)
pub fn resize<S: Dimensions>(&mut self, size: S)
Resize terminal to new dimensions.
pub fn exit(&mut self)where
T: EventListener,
sourcepub fn toggle_vi_mode(&mut self)where
T: EventListener,
pub fn toggle_vi_mode(&mut self)where
T: EventListener,
Toggle the vi mode.
sourcepub fn vi_motion(&mut self, motion: ViMotion)where
T: EventListener,
pub fn vi_motion(&mut self, motion: ViMotion)where
T: EventListener,
Move vi mode cursor.
sourcepub fn vi_goto_point(&mut self, point: Point)where
T: EventListener,
pub fn vi_goto_point(&mut self, point: Point)where
T: EventListener,
Move vi cursor to a point in the grid.
sourcepub fn scroll_to_point(&mut self, point: Point)where
T: EventListener,
pub fn scroll_to_point(&mut self, point: Point)where
T: EventListener,
Scroll display to point if it is outside of viewport.
sourcepub fn expand_wide(&self, point: Point, direction: Direction) -> Point
pub fn expand_wide(&self, point: Point, direction: Direction) -> Point
Jump to the end of a wide cell.
pub fn semantic_escape_chars(&self) -> &str
sourcepub fn cursor_style(&self) -> CursorStyle
pub fn cursor_style(&self) -> CursorStyle
Active terminal cursor style.
While vi mode is active, this will automatically return the vi mode cursor style.
pub fn colors(&self) -> &Colors
Trait Implementations§
source§impl<T> Dimensions for Term<T>
impl<T> Dimensions for Term<T>
source§fn screen_lines(&self) -> usize
fn screen_lines(&self) -> usize
source§fn total_lines(&self) -> usize
fn total_lines(&self) -> usize
source§fn last_column(&self) -> Column
fn last_column(&self) -> Column
source§fn topmost_line(&self) -> Line
fn topmost_line(&self) -> Line
source§fn bottommost_line(&self) -> Line
fn bottommost_line(&self) -> Line
source§fn history_size(&self) -> usize
fn history_size(&self) -> usize
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(
&mut self,
prefix: String,
index: usize,
terminator: &str
)
fn dynamic_color_sequence( &mut self, prefix: String, index: usize, terminator: &str )
Respond to a color query escape sequence.
source§fn reset_color(&mut self, index: usize)
fn reset_color(&mut self, index: usize)
Reset the indexed color to original value.
source§fn clipboard_store(&mut self, clipboard: u8, base64: &[u8])
fn clipboard_store(&mut self, clipboard: u8, base64: &[u8])
Store data into clipboard.
source§fn clipboard_load(&mut self, clipboard: u8, terminator: &str)
fn clipboard_load(&mut self, clipboard: u8, terminator: &str)
Load data from clipboard.
source§fn reset_state(&mut self)
fn reset_state(&mut self)
Reset all important fields in the term struct.
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: usize)
fn insert_blank(&mut self, count: usize)
source§fn move_forward(&mut self, cols: usize)
fn move_forward(&mut self, cols: usize)
cols
.source§fn move_backward(&mut self, cols: usize)
fn move_backward(&mut self, cols: usize)
cols
.source§fn identify_terminal(&mut self, intermediate: Option<char>)
fn identify_terminal(&mut self, intermediate: Option<char>)
source§fn report_keyboard_mode(&mut self)
fn report_keyboard_mode(&mut self)
source§fn push_keyboard_mode(&mut self, mode: KeyboardModes)
fn push_keyboard_mode(&mut self, mode: KeyboardModes)
source§fn pop_keyboard_modes(&mut self, to_pop: u16)
fn pop_keyboard_modes(&mut self, to_pop: u16)
source§fn set_keyboard_mode(
&mut self,
mode: KeyboardModes,
apply: KeyboardModesApplyBehavior
)
fn set_keyboard_mode( &mut self, mode: KeyboardModes, apply: KeyboardModesApplyBehavior )
keyboard mode
using the given behavior
.source§fn device_status(&mut self, arg: usize)
fn device_status(&mut self, arg: usize)
source§fn move_down_and_cr(&mut self, lines: usize)
fn move_down_and_cr(&mut self, lines: usize)
rows
and set to column 1.source§fn move_up_and_cr(&mut self, lines: usize)
fn move_up_and_cr(&mut self, lines: usize)
rows
and set to column 1.source§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: usize)
fn scroll_down(&mut self, lines: usize)
rows
rows.source§fn insert_blank_lines(&mut self, lines: usize)
fn insert_blank_lines(&mut self, lines: usize)
count
blank lines.source§fn delete_lines(&mut self, lines: usize)
fn delete_lines(&mut self, lines: usize)
count
lines.source§fn erase_chars(&mut self, count: usize)
fn erase_chars(&mut self, count: usize)
count
chars in current line following cursor. Read moresource§fn delete_chars(&mut self, count: usize)
fn delete_chars(&mut self, count: usize)
count
chars. Read moresource§fn move_backward_tabs(&mut self, count: u16)
fn move_backward_tabs(&mut self, count: u16)
count
tabs.source§fn move_forward_tabs(&mut self, count: u16)
fn move_forward_tabs(&mut self, count: u16)
count
tabs.source§fn save_cursor_position(&mut self)
fn save_cursor_position(&mut self)
source§fn restore_cursor_position(&mut self)
fn restore_cursor_position(&mut self)
source§fn clear_line(&mut self, mode: LineClearMode)
fn clear_line(&mut self, mode: LineClearMode)
source§fn clear_screen(&mut self, mode: ClearMode)
fn clear_screen(&mut self, mode: ClearMode)
source§fn clear_tabs(&mut self, mode: TabulationClearMode)
fn clear_tabs(&mut self, mode: TabulationClearMode)
source§fn reverse_index(&mut self)
fn reverse_index(&mut self)
source§fn set_hyperlink(&mut self, hyperlink: Option<Hyperlink>)
fn set_hyperlink(&mut self, hyperlink: Option<Hyperlink>)
source§fn set_private_mode(&mut self, mode: PrivateMode)
fn set_private_mode(&mut self, mode: PrivateMode)
source§fn unset_private_mode(&mut self, mode: PrivateMode)
fn unset_private_mode(&mut self, mode: PrivateMode)
source§fn report_private_mode(&mut self, mode: PrivateMode)
fn report_private_mode(&mut self, mode: PrivateMode)
source§fn unset_mode(&mut self, mode: Mode)
fn unset_mode(&mut self, mode: Mode)
source§fn report_mode(&mut self, mode: Mode)
fn report_mode(&mut self, mode: Mode)
source§fn set_scrolling_region(&mut self, top: usize, bottom: Option<usize>)
fn set_scrolling_region(&mut self, top: usize, bottom: Option<usize>)
source§fn set_keypad_application_mode(&mut self)
fn set_keypad_application_mode(&mut self)
source§fn unset_keypad_application_mode(&mut self)
fn unset_keypad_application_mode(&mut self)
source§fn configure_charset(&mut self, index: CharsetIndex, charset: StandardCharset)
fn configure_charset(&mut self, index: CharsetIndex, charset: StandardCharset)
source§fn set_active_charset(&mut self, index: CharsetIndex)
fn set_active_charset(&mut self, index: CharsetIndex)
source§fn set_cursor_style(&mut self, style: Option<CursorStyle>)
fn set_cursor_style(&mut self, style: Option<CursorStyle>)
source§fn set_cursor_shape(&mut self, shape: CursorShape)
fn set_cursor_shape(&mut self, shape: CursorShape)
source§fn push_title(&mut self)
fn push_title(&mut self)
source§fn text_area_size_pixels(&mut self)
fn text_area_size_pixels(&mut self)
source§fn text_area_size_chars(&mut self)
fn text_area_size_chars(&mut self)
source§fn set_mouse_cursor_icon(&mut self, _: CursorIcon)
fn set_mouse_cursor_icon(&mut self, _: CursorIcon)
source§fn set_modify_other_keys(&mut self, _mode: ModifyOtherKeys)
fn set_modify_other_keys(&mut self, _mode: ModifyOtherKeys)
ModifyOtherKeys
option.source§fn report_modify_other_keys(&mut self)
fn report_modify_other_keys(&mut self)
ModifyOtherKeys
state. Read more