Skip to main content

Terminal

Struct Terminal 

Source
pub struct Terminal {
    pub open: bool,
    pub full_panel: bool,
    pub pane_bound: Option<usize>,
    pub started: bool,
    pub close_confirm: bool,
    /* private fields */
}

Fields§

§open: bool§full_panel: bool

When true, terminal fills an editor slot (Ctrl+Shift+T) instead of the side panel (Ctrl+T).

§pane_bound: Option<usize>

When split is active, full terminal is bound to this pane index only (None = fill the whole main editor area).

§started: bool§close_confirm: bool

Full/pane terminal: Esc asked once — wait for y/n before closing.

Implementations§

Source§

impl Terminal

Source

pub fn new() -> Self

Source

pub fn cols(&self) -> u16

Source

pub fn rows_count(&self) -> u16

Source

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

Resize the virtual screen and the real PTY (TIOCSWINSZ → SIGWINCH).

Source

pub fn start(&mut self, anchor: Option<&PathBuf>)

Open a real PTY and spawn the user shell at the current grid size.

Source

pub fn shutdown(&mut self)

Source

pub fn write_input(&mut self, bytes: &[u8])

Source

pub fn paste_input(&mut self, text: &str)

Forward pasted text to the child. When the child enabled bracketed paste (DECSET 2004), wrap it in \x1b[200~ … \x1b[201~ so TUIs (claude, vim, fish) treat it as one paste — not typed keys that auto-submit on newline. This is what makes Cmd+V and file drag-drop deliver a path/blob intact.

Source

pub fn poll(&mut self)

Source

pub fn visible_rows(&self) -> Vec<Vec<(String, Option<Color>, Option<Color>)>>

Source

pub fn wants_mouse(&self) -> bool

Inner app (claude/vim/htop…) asked for mouse events — forward wheel.

Source

pub fn arrow_seq(&self, dir: char) -> &'static [u8]

Arrow-key bytes matching the inner app’s cursor-key mode (DECCKM).

Source

pub fn scroll(&self) -> usize

Source

pub fn scroll_up(&mut self, a: usize)

Source

pub fn scroll_down(&mut self, a: usize)

Source

pub fn scrollback_len(&self) -> usize

Source

pub fn visible_scrollback( &self, ) -> Vec<Vec<(String, Option<Color>, Option<Color>)>>

Source

pub fn cursor_position(&self) -> (u16, u16)

Source

pub fn is_alt_screen(&self) -> bool

Trait Implementations§

Source§

impl Default for Terminal

Source§

fn default() -> Self

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

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, 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.