pub struct TerminalView {
pub tabs: Vec<TerminalTab>,
pub active: usize,
pub search: Option<TerminalSearch>,
pub last_search: Option<TerminalSearch>,
pub next_id: u64,
/* private fields */
}Fields§
§tabs: Vec<TerminalTab>§active: usize§search: Option<TerminalSearch>Active search bar state (None = bar closed).
last_search: Option<TerminalSearch>Retained search state for post-close F3 navigation (like editor’s last_search).
next_id: u64Monotonically-increasing counter for new tab IDs.
Implementations§
Source§impl TerminalView
impl TerminalView
pub fn new() -> Self
Sourcepub fn update_from_settings(&mut self, settings: &Settings)
pub fn update_from_settings(&mut self, settings: &Settings)
Update configuration from settings. Call this when settings change or when the terminal view becomes active.
Sourcepub fn spawn_tab(
&mut self,
command: Option<String>,
shell_setting: &str,
cwd: &Path,
op_tx: &UnboundedSender<Vec<Operation>>,
scrollback: usize,
)
pub fn spawn_tab( &mut self, command: Option<String>, shell_setting: &str, cwd: &Path, op_tx: &UnboundedSender<Vec<Operation>>, scrollback: usize, )
Spawn a new PTY tab running command (defaults to configured/env shell).
Starts an async read task that forwards output via op_tx.
scrollback is the number of history lines to keep per tab.
Sourcepub fn write_input(&mut self, id: u64, data: &[u8])
pub fn write_input(&mut self, id: u64, data: &[u8])
Write raw bytes to the PTY of the tab with the given ID.
Sourcepub fn resize_all(&mut self, rows: u16, cols: u16)
pub fn resize_all(&mut self, rows: u16, cols: u16)
Resize the PTY and vt100 parser for every tab.
pub fn detect_links_for_tab(tab: &TerminalTab) -> Vec<Link>
pub fn to_state(&self) -> TerminalStateStore
Source§impl TerminalView
impl TerminalView
Sourcepub fn handle_paste(&self, text: &str) -> Vec<Operation>
pub fn handle_paste(&self, text: &str) -> Vec<Operation>
Forward bracketed-paste content to the active PTY tab as raw bytes.
Trait Implementations§
Source§impl Debug for TerminalView
impl Debug for TerminalView
Source§impl Default for TerminalView
impl Default for TerminalView
Source§impl View for TerminalView
impl View for TerminalView
Source§fn save_state(&mut self, app: &mut AppState)
fn save_state(&mut self, app: &mut AppState)
Save the current state of the view before it is closed.
Source§fn status_bar(&self, _state: &AppState, bar: &mut StatusBarBuilder)
fn status_bar(&self, _state: &AppState, bar: &mut StatusBarBuilder)
Populate the global status bar with view-specific content. Read more
Source§fn handle_key(&self, key: KeyEvent) -> Vec<Operation>
fn handle_key(&self, key: KeyEvent) -> Vec<Operation>
Translate a key event into zero or more operations.
Must not mutate
self — use handle_operation for that.Source§fn handle_mouse(&self, mouse: MouseEvent) -> Vec<Operation>
fn handle_mouse(&self, mouse: MouseEvent) -> Vec<Operation>
Translate a mouse event into zero or more operations.
Default implementation is a no-op; views that support mouse override this.
Auto Trait Implementations§
impl !Freeze for TerminalView
impl !RefUnwindSafe for TerminalView
impl Send for TerminalView
impl !Sync for TerminalView
impl Unpin for TerminalView
impl UnsafeUnpin for TerminalView
impl !UnwindSafe for TerminalView
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> 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