Skip to main content

RuntimeAdapter

Trait RuntimeAdapter 

Source
pub trait RuntimeAdapter: Send + Sync {
Show 24 methods // Required methods fn list_all_panes(&self) -> Result<Vec<PaneInfo>>; fn list_panes(&self) -> Result<Vec<PaneInfo>>; fn list_sessions(&self) -> Result<Vec<String>>; fn is_available(&self) -> bool; fn capture_pane(&self, target: &str) -> Result<String>; fn capture_pane_plain(&self, target: &str) -> Result<String>; fn get_pane_title(&self, target: &str) -> Result<String>; fn send_keys(&self, target: &str, keys: &str) -> Result<()>; fn send_keys_literal(&self, target: &str, keys: &str) -> Result<()>; fn send_text_and_enter(&self, target: &str, text: &str) -> Result<()>; fn focus_pane(&self, target: &str) -> Result<()>; fn kill_pane(&self, target: &str) -> Result<()>; fn name(&self) -> &str; // Provided methods fn capture_pane_full(&self, target: &str) -> Result<String> { ... } fn get_cursor_position(&self, _target: &str) -> Result<Option<(u32, u32)>> { ... } fn create_session( &self, _name: &str, _cwd: &str, _window_name: Option<&str>, ) -> Result<()> { ... } fn new_window( &self, _session: &str, _cwd: &str, _window_name: Option<&str>, ) -> Result<String> { ... } fn split_window(&self, _session: &str, _cwd: &str) -> Result<String> { ... } fn split_window_tiled(&self, session: &str, cwd: &str) -> Result<String> { ... } fn select_layout(&self, _target: &str, _layout: &str) -> Result<()> { ... } fn count_panes(&self, _target: &str) -> Result<usize> { ... } fn run_command(&self, _target: &str, _command: &str) -> Result<()> { ... } fn run_command_wrapped(&self, _target: &str, _command: &str) -> Result<()> { ... } fn get_current_location(&self) -> Result<(String, u32)> { ... }
}
Expand description

Abstraction over the terminal multiplexer / process runtime.

Implementors provide agent discovery, screen observation, key control, and optional session management. Methods are sync because TmuxClient is subprocess-based (Poller already runs in a tokio blocking task).

Required Methods§

Source

fn list_all_panes(&self) -> Result<Vec<PaneInfo>>

List all panes/agents across all sessions (including detached).

Source

fn list_panes(&self) -> Result<Vec<PaneInfo>>

List panes from attached sessions only.

Source

fn list_sessions(&self) -> Result<Vec<String>>

List session names.

Source

fn is_available(&self) -> bool

Check if the runtime backend is available and operational.

Source

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

Capture pane content with ANSI escape codes (for preview rendering).

Source

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

Capture pane content as plain text (for detection analysis).

Source

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

Get the title of a pane.

Source

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

Send interpreted keys to a pane (e.g., “Enter”, “C-c”).

Source

fn send_keys_literal(&self, target: &str, keys: &str) -> Result<()>

Send literal text to a pane (no key interpretation).

Source

fn send_text_and_enter(&self, target: &str, text: &str) -> Result<()>

Send literal text followed by Enter.

Source

fn focus_pane(&self, target: &str) -> Result<()>

Focus on a pane (bring to foreground in the runtime).

Source

fn kill_pane(&self, target: &str) -> Result<()>

Terminate a pane / agent process.

Source

fn name(&self) -> &str

Runtime name for logging and display (e.g., “tmux”, “standalone”).

Provided Methods§

Source

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

Capture full scrollback with ANSI escape codes (all history).

Source

fn get_cursor_position(&self, _target: &str) -> Result<Option<(u32, u32)>>

Get terminal cursor position (col, row) for a pane, both 0-indexed. Returns None if the runtime does not support cursor queries.

Source

fn create_session( &self, _name: &str, _cwd: &str, _window_name: Option<&str>, ) -> Result<()>

Create a new session. Not all runtimes support this.

Source

fn new_window( &self, _session: &str, _cwd: &str, _window_name: Option<&str>, ) -> Result<String>

Create a new window in a session. Returns the new pane target.

Source

fn split_window(&self, _session: &str, _cwd: &str) -> Result<String>

Split a window to create a new pane. Returns the new pane target.

Source

fn split_window_tiled(&self, session: &str, cwd: &str) -> Result<String>

Split a window and apply tiled layout for balanced pane sizes.

Source

fn select_layout(&self, _target: &str, _layout: &str) -> Result<()>

Apply a layout to the window containing the target (e.g. “tiled”).

Source

fn count_panes(&self, _target: &str) -> Result<usize>

Count panes in the window containing the target.

Source

fn run_command(&self, _target: &str, _command: &str) -> Result<()>

Run a command in a pane (send text + Enter).

Source

fn run_command_wrapped(&self, _target: &str, _command: &str) -> Result<()>

Run a command wrapped with tmai wrap for PTY monitoring.

Source

fn get_current_location(&self) -> Result<(String, u32)>

Get the user’s current location (session name, window index).

Implementors§