pub struct App<S> { /* private fields */ }Expand description
High-level handle to the iTerm2 application.
Provides ergonomic methods for listing sessions, creating tabs, managing
transactions, and subscribing to notifications. Wraps an Arc<Connection>.
Implementations§
Source§impl<S: AsyncRead + AsyncWrite + Unpin + Send + 'static> App<S>
impl<S: AsyncRead + AsyncWrite + Unpin + Send + 'static> App<S>
Sourcepub fn new(conn: Connection<S>) -> Self
pub fn new(conn: Connection<S>) -> Self
Create an App from a Connection.
Sourcepub fn from_arc(conn: Arc<Connection<S>>) -> Self
pub fn from_arc(conn: Arc<Connection<S>>) -> Self
Create an App from a shared connection.
Sourcepub async fn list_sessions(&self) -> Result<ListSessionsResult<S>>
pub async fn list_sessions(&self) -> Result<ListSessionsResult<S>>
List all windows, tabs, and sessions in iTerm2.
Sourcepub async fn create_tab(
&self,
profile_name: Option<&str>,
window_id: Option<&str>,
) -> Result<CreateTabResult<S>>
pub async fn create_tab( &self, profile_name: Option<&str>, window_id: Option<&str>, ) -> Result<CreateTabResult<S>>
Create a new tab, optionally in an existing window with a named profile.
Sourcepub async fn focus(&self) -> Result<Vec<FocusChangedNotification>>
pub async fn focus(&self) -> Result<Vec<FocusChangedNotification>>
Get the current focus state (active window, tab, session).
Sourcepub async fn activate(
&self,
raise_all: bool,
ignoring_other_apps: bool,
) -> Result<()>
pub async fn activate( &self, raise_all: bool, ignoring_other_apps: bool, ) -> Result<()>
Activate the iTerm2 application, optionally raising all windows.
Sourcepub async fn list_profiles(
&self,
properties: Vec<String>,
guids: Vec<String>,
) -> Result<ListProfilesResponse>
pub async fn list_profiles( &self, properties: Vec<String>, guids: Vec<String>, ) -> Result<ListProfilesResponse>
List profiles, optionally filtering by properties and GUIDs.
Sourcepub async fn begin_transaction(&self) -> Result<()>
pub async fn begin_transaction(&self) -> Result<()>
Begin a transaction. The app’s main loop freezes until end_transaction is called.
Sourcepub async fn end_transaction(&self) -> Result<()>
pub async fn end_transaction(&self) -> Result<()>
End a previously started transaction.
Sourcepub async fn list_color_presets(&self) -> Result<Vec<String>>
pub async fn list_color_presets(&self) -> Result<Vec<String>>
List available color preset names.
Sourcepub async fn list_arrangements(&self) -> Result<Vec<String>>
pub async fn list_arrangements(&self) -> Result<Vec<String>>
List saved window arrangement names.
Sourcepub async fn get_broadcast_domains(&self) -> Result<Vec<BroadcastDomain>>
pub async fn get_broadcast_domains(&self) -> Result<Vec<BroadcastDomain>>
Get broadcast domains (groups of sessions that receive the same input).
Sourcepub fn subscribe_notifications(&self) -> Receiver<Notification>
pub fn subscribe_notifications(&self) -> Receiver<Notification>
Subscribe to spontaneous notifications from iTerm2.
Sourcepub fn connection(&self) -> &Connection<S>
pub fn connection(&self) -> &Connection<S>
Get a reference to the underlying connection.
Sourcepub fn connection_arc(&self) -> Arc<Connection<S>>
pub fn connection_arc(&self) -> Arc<Connection<S>>
Get a shared reference to the underlying connection.