Skip to main content

TerminalPane

Struct TerminalPane 

Source
pub struct TerminalPane { /* private fields */ }
Expand description

A terminal pane being built: terminal or terminal_with, then node (or .into()) to place it.

The program starts when the pane is first laid out, at the pane’s size, and is told every new size after. While the pane has the focus, every key goes to the program (Ctrl+C and Tab included) except the ones release_keys names, which go to the app; the mouse goes to it when it asked for the mouse, and pastes always do. Shift+PgUp and Shift+PgDn, and the wheel when the program does not want the mouse, scroll back through what scrolled off the top; any other key returns to the live screen. When the program exits its last screen stays, status is set, on_exit runs, and keys go to the app again. The program is ended when the pane leaves the tree.

Implementations§

Source§

impl TerminalPane

Source

pub fn on_exit( self, handler: impl FnMut(ExitStatus, &mut Ctx) + 'static, ) -> TerminalPane

Run handler on the app’s thread when the program exits, with how it ended.

Source

pub fn status(&self) -> Signal<Option<ExitStatus>>

How the program ended: None while it runs. Read it in a node to show it.

Source

pub fn scrollback(self, rows: usize) -> TerminalPane

Keep up to rows rows that scrolled off the top (default DEFAULT_SCROLLBACK). Before the pane is first laid out.

Source

pub fn release_keys(self, keys: &str) -> TerminalPane

Keys (space-separated names, as Node::on_key takes them) that are not sent to the program but go on to the app’s bindings: a way out of the pane, such as "ctrl+q f10".

Source

pub fn node(self) -> Node

The pane as a node: focusable, and flexible like any node until sized.

Trait Implementations§

Source§

impl From<TerminalPane> for Node

Source§

fn from(pane: TerminalPane) -> Node

Converts to this type from the input type.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.