pub struct VT100Term {
pub title: String,
pub focused: bool,
pub copy_mode: CopyMode,
pub border_style: Style,
pub focused_border_style: Style,
/* private fields */
}Available on crate feature
terminal only.Expand description
VT100 Terminal Widget
This terminal uses termwiz for parsing and a custom VT100 implementation for state management, giving us full control over scrollback and selection.
Fields§
§title: StringTitle for the terminal
focused: boolWhether the terminal has focus
copy_mode: CopyModeCopy mode state
border_style: Style§focused_border_style: StyleImplementations§
Source§impl VT100Term
impl VT100Term
Sourcepub fn handle_key(&mut self, key: KeyEvent) -> bool
pub fn handle_key(&mut self, key: KeyEvent) -> bool
Handle keyboard input
Sourcepub fn handle_mouse_down(&mut self, x: u16, y: u16)
pub fn handle_mouse_down(&mut self, x: u16, y: u16)
Handle mouse selection
Sourcepub fn handle_mouse_drag(&mut self, x: u16, y: u16)
pub fn handle_mouse_drag(&mut self, x: u16, y: u16)
Handle mouse drag
Sourcepub fn handle_mouse_up(&mut self)
pub fn handle_mouse_up(&mut self)
Handle mouse up
Sourcepub fn scroll_down(&mut self, lines: usize)
pub fn scroll_down(&mut self, lines: usize)
Scroll down
Sourcepub fn clear_selection(&mut self)
pub fn clear_selection(&mut self)
Clear selection
Sourcepub fn has_selection(&self) -> bool
pub fn has_selection(&self) -> bool
Check if has selection
Sourcepub fn get_selected_text(&self) -> Option<String>
pub fn get_selected_text(&self) -> Option<String>
Get selected text
Sourcepub fn spawn_with_command(
title: impl Into<String>,
command: &str,
args: &[&str],
) -> Result<Self>
pub fn spawn_with_command( title: impl Into<String>, command: &str, args: &[&str], ) -> Result<Self>
Spawn a terminal with a command
Sourcepub fn send_input(&self, text: &str)
pub fn send_input(&self, text: &str)
Send input to the terminal
Sourcepub fn render_content(&mut self, frame: &mut Frame<'_>, area: Rect)
pub fn render_content(&mut self, frame: &mut Frame<'_>, area: Rect)
Render the terminal
Auto Trait Implementations§
impl Freeze for VT100Term
impl !RefUnwindSafe for VT100Term
impl Send for VT100Term
impl Sync for VT100Term
impl Unpin for VT100Term
impl !UnwindSafe for VT100Term
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more