iterm

package
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client implements terminal.Backend using iTerm2's native protobuf-over-WebSocket API.

func NewClient

func NewClient(socketPath ...string) *Client

NewClient creates a new Client. Optional socketPath overrides the default iTerm2 Unix socket location.

func (*Client) Available

func (c *Client) Available() error

Available checks if iTerm2 is reachable by listing sessions via Unix socket.

func (*Client) Close

func (c *Client) Close()

Close closes the underlying WebSocket connection.

func (*Client) FocusSession

func (c *Client) FocusSession(sessionID string) error

FocusSession activates the session, its tab, and brings the window to front. Uses idempotentRequest since activating is safe to retry.

func (*Client) GetVar

func (c *Client) GetVar(sessionID, varName string) (string, error)

GetVar reads a variable from a session.

func (*Client) ListSessions

func (c *Client) ListSessions() ([]terminal.Session, error)

ListSessions returns all iTerm2 sessions (panes), including those in splits.

func (*Client) MonitorOutput

func (c *Client) MonitorOutput(sessionID, logPath, patterns string) (int, error)

MonitorOutput is not supported by the iTerm2 backend. Screen reads are the primary status detection mechanism.

func (*Client) NewSession

func (c *Client) NewSession() (string, error)

NewSession creates a new tab in the focused iTerm2 window and returns its session ID.

func (*Client) ReadScreen

func (c *Client) ReadScreen(sessionID string, lines int) (string, error)

ReadScreen captures the visible screen contents of a session.

func (*Client) RunCommand

func (c *Client) RunCommand(sessionID, cmd string) error

RunCommand sends a command followed by Enter to a session.

func (*Client) SendText

func (c *Client) SendText(sessionID, text string) error

SendText sends raw text to a session.

func (*Client) SetNoPrompt

func (c *Client) SetNoPrompt(v bool)

SetNoPrompt suppresses interactive AppleScript auth dialogs. When set, the client returns an error instead of prompting if auth is required.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL