Skip to main content

SessionManager

Struct SessionManager 

Source
pub struct SessionManager { /* private fields */ }

Implementations§

Source§

impl SessionManager

Source

pub fn save_layout( &self, session_name: &str, window_id: WindowId, name: &str, ) -> Result<()>

Source

pub fn load_layout( &mut self, session_name: &str, window_id: WindowId, name: &str, ) -> LayoutResult

Source

pub fn list_layouts(&self) -> Vec<LayoutListEntry>

Source

pub fn resolve_layout_name(&self, name: &str) -> Result<()>

Resolve a layout name: config → saved files → presets. Used by –layout flag on session/window creation.

Source§

impl SessionManager

Source

pub fn new(pty_factory: PtyFactory, config: AimuxConfig) -> Self

Source

pub fn set_self_arc(&mut self, arc: &Arc<Mutex<SessionManager>>)

Source

pub fn allocate_pane_id(&self) -> PaneId

Source

pub fn default_session_options(&self) -> SessionOptions

Source

pub fn reload_config(&mut self, config: AimuxConfig)

Source

pub fn server_status(&self) -> ServerStatusInfo

Source

pub fn config(&self) -> &AimuxConfig

Source

pub fn resolve_pane_target(&self, target: &str) -> Result<String>

Source

pub fn set_mark(&mut self, mark: &str, pane_id: &str) -> Result<()>

Source

pub fn remove_mark(&mut self, mark: &str) -> Result<()>

Source

pub fn list_marks(&self) -> Vec<(String, String)>

Source

pub fn marks_for_pane(&self, pane_id: &str) -> Vec<String>

Source

pub fn apply_layout( &mut self, session_name: &str, window_id: WindowId, layout_name: &str, ) -> LayoutResult

Apply a named layout from config to a window. Creates/kills panes to match leaf count, sets Custom layout, applies marks. Returns (pane_ids, backends_to_close) so the caller can close backends outside the lock.

Source

pub fn select_layout( &mut self, session_name: &str, window_id: WindowId, layout_name: &str, ) -> Result<()>

Select a preset layout for an existing window.

Source

pub fn new_session( &mut self, name: &str, shell: Option<&str>, ) -> Result<(SessionId, PaneId)>

Source

pub fn kill_session(&mut self, name: &str) -> Result<Vec<Box<dyn PtyBackend>>>

Source

pub fn list_sessions(&self) -> Vec<SessionInfo>

Source

pub fn has_session(&self, name: &str) -> bool

Source

pub fn get_session(&self, name: &str) -> Option<&Session>

Source

pub fn get_session_mut(&mut self, name: &str) -> Option<&mut Session>

Source

pub fn find_pane(&self, pane_id: &str) -> Option<(&Session, &Window, &Pane)>

Find a pane by its global ID across all sessions.

Source

pub fn find_pane_mut(&mut self, pane_id: &str) -> Option<&mut Pane>

Find a mutable pane by its global ID.

Source

pub fn get_prompt_pattern(&self, pane_id: &str) -> Option<String>

Get the prompt pattern for a pane’s parent session.

Source

pub fn send_keys(&self, pane_id: &str, keys: &str) -> Result<()>

Send keys to a pane. Returns error if the pane has exited.

Source

pub fn get_capture_info( &self, pane_id: &str, ) -> Result<(Arc<RwLock<Screen>>, ProcessInfo)>

Get the screen and process info needed for a capture, without awaiting. Returns (screen_arc, process_info) so the caller can await the read lock without holding a reference to SessionManager across the await point.

Source

pub fn new_window( &mut self, session_name: &str, shell: Option<&str>, ) -> Result<(WindowId, PaneId)>

Create a new window in a session.

Source

pub fn kill_window( &mut self, session_name: &str, window_id: WindowId, ) -> Result<Vec<Box<dyn PtyBackend>>>

Kill a window. If it was the last window, kills the session too. Returns backends for the caller to close outside the lock.

Source

pub fn split_pane( &mut self, pane_id: &str, horizontal: bool, shell: Option<&str>, ) -> Result<PaneId>

Split a pane, adding a new pane to the same window.

Source

pub fn kill_pane(&mut self, pane_id: &str) -> Result<Vec<Box<dyn PtyBackend>>>

Kill a pane. Cascades: last pane kills window, last window kills session. Returns backends for the caller to close outside the lock.

Source

pub fn list_panes(&self, session_name: &str) -> Result<Vec<PaneInfo>>

List panes for a session.

Source

pub fn select_window( &mut self, session_name: &str, window_id: WindowId, ) -> Result<()>

Select a window as active in a session.

Source

pub fn select_pane(&mut self, pane_id: &str) -> Result<()>

Select a pane as active, finding it across all sessions.

Source

pub fn swap_panes(&mut self, pane_a: &str, pane_b: &str) -> Result<()>

Swap two panes’ positions within the same window.

Source

pub fn move_pane( &mut self, pane_id: &str, target_session: &str, target_window_id: WindowId, ) -> Result<()>

Move a pane from its current window to a different window.

Source

pub fn list_windows(&self, session_name: &str) -> Result<Vec<WindowInfo>>

List windows for a session.

Source

pub fn resize_pane_pty( &mut self, pane_id: &str, cols: u16, rows: u16, ) -> Result<Arc<RwLock<Screen>>>

Resize a pane’s PTY backend and update its stored size. Returns the screen Arc so the caller can resize the screen after dropping the manager lock.

Source

pub fn shutdown_all(&mut self) -> Vec<Box<dyn PtyBackend>>

Shut down all sessions. Returns backends for the caller to close.

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more