Skip to main content

App

Struct App 

Source
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>

Source

pub fn new(conn: Connection<S>) -> Self

Create an App from a Connection.

Source

pub fn from_arc(conn: Arc<Connection<S>>) -> Self

Create an App from a shared connection.

Source

pub async fn list_sessions(&self) -> Result<ListSessionsResult<S>>

List all windows, tabs, and sessions in iTerm2.

Source

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.

Source

pub async fn focus(&self) -> Result<Vec<FocusChangedNotification>>

Get the current focus state (active window, tab, session).

Source

pub async fn activate( &self, raise_all: bool, ignoring_other_apps: bool, ) -> Result<()>

Activate the iTerm2 application, optionally raising all windows.

Source

pub async fn list_profiles( &self, properties: Vec<String>, guids: Vec<String>, ) -> Result<ListProfilesResponse>

List profiles, optionally filtering by properties and GUIDs.

Source

pub async fn begin_transaction(&self) -> Result<()>

Begin a transaction. The app’s main loop freezes until end_transaction is called.

Source

pub async fn end_transaction(&self) -> Result<()>

End a previously started transaction.

Source

pub async fn list_color_presets(&self) -> Result<Vec<String>>

List available color preset names.

Source

pub async fn list_arrangements(&self) -> Result<Vec<String>>

List saved window arrangement names.

Source

pub async fn get_broadcast_domains(&self) -> Result<Vec<BroadcastDomain>>

Get broadcast domains (groups of sessions that receive the same input).

Source

pub fn subscribe_notifications(&self) -> Receiver<Notification>

Subscribe to spontaneous notifications from iTerm2.

Source

pub fn connection(&self) -> &Connection<S>

Get a reference to the underlying connection.

Source

pub fn connection_arc(&self) -> Arc<Connection<S>>

Get a shared reference to the underlying connection.

Auto Trait Implementations§

§

impl<S> Freeze for App<S>

§

impl<S> !RefUnwindSafe for App<S>

§

impl<S> Send for App<S>
where S: Send,

§

impl<S> Sync for App<S>
where S: Send,

§

impl<S> Unpin for App<S>

§

impl<S> UnsafeUnpin for App<S>

§

impl<S> !UnwindSafe for App<S>

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, 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> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V