Documentation
¶
Index ¶
- type Client
- func (c *Client) Available() error
- func (c *Client) Close()
- func (c *Client) FocusSession(sessionID string) error
- func (c *Client) GetVar(sessionID, varName string) (string, error)
- func (c *Client) ListSessions() ([]terminal.Session, error)
- func (c *Client) MonitorOutput(sessionID, logPath, patterns string) (int, error)
- func (c *Client) NewSession() (string, error)
- func (c *Client) ReadScreen(sessionID string, lines int) (string, error)
- func (c *Client) RunCommand(sessionID, cmd string) error
- func (c *Client) SendText(sessionID, text string) error
- func (c *Client) SetNoPrompt(v bool)
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 ¶
NewClient creates a new Client. Optional socketPath overrides the default iTerm2 Unix socket location.
func (*Client) Available ¶
Available checks if iTerm2 is reachable by listing sessions via Unix socket.
func (*Client) FocusSession ¶
FocusSession activates the session, its tab, and brings the window to front. Uses idempotentRequest since activating is safe to retry.
func (*Client) ListSessions ¶
ListSessions returns all iTerm2 sessions (panes), including those in splits.
func (*Client) MonitorOutput ¶
MonitorOutput is not supported by the iTerm2 backend. Screen reads are the primary status detection mechanism.
func (*Client) NewSession ¶
NewSession creates a new tab in the focused iTerm2 window and returns its session ID.
func (*Client) ReadScreen ¶
ReadScreen captures the visible screen contents of a session.
func (*Client) RunCommand ¶
RunCommand sends a command followed by Enter to a session.
func (*Client) SetNoPrompt ¶
SetNoPrompt suppresses interactive AppleScript auth dialogs. When set, the client returns an error instead of prompting if auth is required.