pub struct Session { /* private fields */ }Expand description
A shell running in the panel.
Implementations§
Source§impl Session
impl Session
Sourcepub fn spawn(
id: u64,
label: &str,
argv: &[String],
cwd: &Path,
(rows, cols): (u16, u16),
notify: Sender<WorkerMsg>,
) -> Result<Self, String>
pub fn spawn( id: u64, label: &str, argv: &[String], cwd: &Path, (rows, cols): (u16, u16), notify: Sender<WorkerMsg>, ) -> Result<Self, String>
Starts argv in cwd inside a pseudo-terminal of rows × cols.
Output and exit are reported on notify as WorkerMsg::TerminalOutput
and WorkerMsg::TerminalExited, tagged with id.
§Errors
Returns a description of what failed — the pseudo-terminal could not be created, or the program could not be started (most often: not found).
Sourcepub fn screen(&self) -> MutexGuard<'_, Parser<Replies>>
pub fn screen(&self) -> MutexGuard<'_, Parser<Replies>>
Locks the screen for reading or for a scroll change.
Held only for as long as one frame takes to copy cells out, so the reader thread is never kept waiting for longer than that.
Sourcepub fn output_drawn(&self)
pub fn output_drawn(&self)
Lets the reader announce new output again, once the last batch is on screen.
Sourcepub fn resize(&mut self, (rows, cols): (u16, u16))
pub fn resize(&mut self, (rows, cols): (u16, u16))
Resizes the pseudo-terminal and the screen to rows × cols, if they
changed. Cheap enough to call every frame.
Sourcepub fn scroll(&self, delta: isize)
pub fn scroll(&self, delta: isize)
Scrolls the view delta rows into the scrollback (positive is back in
time), clamped to what the scrollback holds.
Sourcepub fn scroll_to_bottom(&self)
pub fn scroll_to_bottom(&self)
Returns the view to the live screen.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Session
impl !Sync for Session
impl !UnwindSafe for Session
impl Freeze for Session
impl Send for Session
impl Unpin for Session
impl UnsafeUnpin for Session
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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