Skip to main content

TerminalView

Struct TerminalView 

Source
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: u64

Monotonically-increasing counter for new tab IDs.

Implementations§

Source§

impl TerminalView

Source

pub fn new() -> Self

Source

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.

Source

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.

Source

pub fn write_input(&mut self, id: u64, data: &[u8])

Write raw bytes to the PTY of the tab with the given ID.

Source

pub fn resize_all(&mut self, rows: u16, cols: u16)

Resize the PTY and vt100 parser for every tab.

Source

pub fn to_state(&self) -> TerminalStateStore

Source§

impl TerminalView

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TerminalView

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl View for TerminalView

Source§

const KIND: ViewKind = crate::views::ViewKind::Primary

The kind of this view: ViewKind::Primary or ViewKind::Modal. Read more
Source§

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)

Populate the global status bar with view-specific content. Read more
Source§

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>

Translate a mouse event into zero or more operations. Default implementation is a no-op; views that support mouse override this.
Source§

fn handle_operation( &mut self, op: &Operation, settings: &Settings, ) -> Option<Event>

Apply a single operation if it is relevant to this view. Read more
Source§

fn render(&self, frame: &mut Frame<'_>, area: Rect, _theme: &Theme)

Draw the view into the provided area of the current frame.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.