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§
Sourcefn list_all_panes(&self) -> Result<Vec<PaneInfo>>
fn list_all_panes(&self) -> Result<Vec<PaneInfo>>
List all panes/agents across all sessions (including detached).
Sourcefn list_panes(&self) -> Result<Vec<PaneInfo>>
fn list_panes(&self) -> Result<Vec<PaneInfo>>
List panes from attached sessions only.
Sourcefn list_sessions(&self) -> Result<Vec<String>>
fn list_sessions(&self) -> Result<Vec<String>>
List session names.
Sourcefn is_available(&self) -> bool
fn is_available(&self) -> bool
Check if the runtime backend is available and operational.
Sourcefn capture_pane(&self, target: &str) -> Result<String>
fn capture_pane(&self, target: &str) -> Result<String>
Capture pane content with ANSI escape codes (for preview rendering).
Sourcefn capture_pane_plain(&self, target: &str) -> Result<String>
fn capture_pane_plain(&self, target: &str) -> Result<String>
Capture pane content as plain text (for detection analysis).
Sourcefn get_pane_title(&self, target: &str) -> Result<String>
fn get_pane_title(&self, target: &str) -> Result<String>
Get the title of a pane.
Sourcefn send_keys(&self, target: &str, keys: &str) -> Result<()>
fn send_keys(&self, target: &str, keys: &str) -> Result<()>
Send interpreted keys to a pane (e.g., “Enter”, “C-c”).
Sourcefn send_keys_literal(&self, target: &str, keys: &str) -> Result<()>
fn send_keys_literal(&self, target: &str, keys: &str) -> Result<()>
Send literal text to a pane (no key interpretation).
Sourcefn send_text_and_enter(&self, target: &str, text: &str) -> Result<()>
fn send_text_and_enter(&self, target: &str, text: &str) -> Result<()>
Send literal text followed by Enter.
Sourcefn focus_pane(&self, target: &str) -> Result<()>
fn focus_pane(&self, target: &str) -> Result<()>
Focus on a pane (bring to foreground in the runtime).
Provided Methods§
Sourcefn capture_pane_full(&self, target: &str) -> Result<String>
fn capture_pane_full(&self, target: &str) -> Result<String>
Capture full scrollback with ANSI escape codes (all history).
Sourcefn get_cursor_position(&self, _target: &str) -> Result<Option<(u32, u32)>>
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.
Sourcefn create_session(
&self,
_name: &str,
_cwd: &str,
_window_name: Option<&str>,
) -> Result<()>
fn create_session( &self, _name: &str, _cwd: &str, _window_name: Option<&str>, ) -> Result<()>
Create a new session. Not all runtimes support this.
Sourcefn new_window(
&self,
_session: &str,
_cwd: &str,
_window_name: Option<&str>,
) -> Result<String>
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.
Sourcefn split_window(&self, _session: &str, _cwd: &str) -> Result<String>
fn split_window(&self, _session: &str, _cwd: &str) -> Result<String>
Split a window to create a new pane. Returns the new pane target.
Sourcefn split_window_tiled(&self, session: &str, cwd: &str) -> Result<String>
fn split_window_tiled(&self, session: &str, cwd: &str) -> Result<String>
Split a window and apply tiled layout for balanced pane sizes.
Sourcefn select_layout(&self, _target: &str, _layout: &str) -> Result<()>
fn select_layout(&self, _target: &str, _layout: &str) -> Result<()>
Apply a layout to the window containing the target (e.g. “tiled”).
Sourcefn count_panes(&self, _target: &str) -> Result<usize>
fn count_panes(&self, _target: &str) -> Result<usize>
Count panes in the window containing the target.
Sourcefn run_command(&self, _target: &str, _command: &str) -> Result<()>
fn run_command(&self, _target: &str, _command: &str) -> Result<()>
Run a command in a pane (send text + Enter).
Sourcefn run_command_wrapped(&self, _target: &str, _command: &str) -> Result<()>
fn run_command_wrapped(&self, _target: &str, _command: &str) -> Result<()>
Run a command wrapped with tmai wrap for PTY monitoring.
Sourcefn get_current_location(&self) -> Result<(String, u32)>
fn get_current_location(&self) -> Result<(String, u32)>
Get the user’s current location (session name, window index).