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: boolWhen 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: boolFull/pane terminal: Esc asked once — wait for y/n before closing.
Implementations§
Source§impl Terminal
impl Terminal
pub fn new() -> Self
pub fn cols(&self) -> u16
pub fn rows_count(&self) -> u16
Sourcepub fn resize(&mut self, cols: u16, rows: u16)
pub fn resize(&mut self, cols: u16, rows: u16)
Resize the virtual screen and the real PTY (TIOCSWINSZ → SIGWINCH).
Sourcepub fn start(&mut self, anchor: Option<&PathBuf>)
pub fn start(&mut self, anchor: Option<&PathBuf>)
Open a real PTY and spawn the user shell at the current grid size.
pub fn shutdown(&mut self)
pub fn write_input(&mut self, bytes: &[u8])
Sourcepub fn paste_input(&mut self, text: &str)
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.
pub fn poll(&mut self)
pub fn visible_rows(&self) -> Vec<Vec<(String, Option<Color>, Option<Color>)>>
Sourcepub fn wants_mouse(&self) -> bool
pub fn wants_mouse(&self) -> bool
Inner app (claude/vim/htop…) asked for mouse events — forward wheel.
Sourcepub fn arrow_seq(&self, dir: char) -> &'static [u8] ⓘ
pub fn arrow_seq(&self, dir: char) -> &'static [u8] ⓘ
Arrow-key bytes matching the inner app’s cursor-key mode (DECCKM).
pub fn scroll(&self) -> usize
pub fn scroll_up(&mut self, a: usize)
pub fn scroll_down(&mut self, a: usize)
pub fn scrollback_len(&self) -> usize
pub fn visible_scrollback( &self, ) -> Vec<Vec<(String, Option<Color>, Option<Color>)>>
pub fn cursor_position(&self) -> (u16, u16)
pub fn is_alt_screen(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Terminal
impl !Sync for Terminal
impl !UnwindSafe for Terminal
impl Freeze for Terminal
impl Send for Terminal
impl Unpin for Terminal
impl UnsafeUnpin for Terminal
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
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>
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>
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)
&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)
&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>
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>
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