Documentation
¶
Index ¶
- func NormalizeSessionID(sessionID string) string
- func NotificationEventTypes() []string
- func NotificationEventTypesAll() []string
- func NotificationEventTypesGlobal() []string
- func NotificationTypeFromString(event string) (pb.NotificationType, error)
- func NotificationTypeToString(notifType pb.NotificationType) string
- type BroadcastDomain
- type Client
- func (c *Client) ActivateSession(ctx context.Context, sessionID string, selectSession bool) (*pb.ActivateResponse, error)
- func (c *Client) ActivateSessionWithOptions(ctx context.Context, sessionID string, ...) (*pb.ActivateResponse, error)
- func (c *Client) ActivateTab(ctx context.Context, tabID string, selectTab bool) (*pb.ActivateResponse, error)
- func (c *Client) ActivateWindow(ctx context.Context, windowID string, orderFront bool) (*pb.ActivateResponse, error)
- func (c *Client) ApplyColorPreset(ctx context.Context, presetName, profileName string) error
- func (c *Client) BindKey(ctx context.Context, key, action, profile string, global bool, ...) error
- func (c *Client) ClearBuffer(ctx context.Context, sessionID string, scrollback, screenOnly bool) error
- func (c *Client) ClearHighlights(ctx context.Context, sessionID string) error
- func (c *Client) ClearSelection(ctx context.Context, sessionID string) error
- func (c *Client) ClearSessionBadge(ctx context.Context, sessionID string) error
- func (c *Client) ClearTabColor(ctx context.Context, tabID string) error
- func (c *Client) ClearTabTitle(ctx context.Context, tabID string) error
- func (c *Client) ClearWindowTitle(ctx context.Context, windowID string) error
- func (c *Client) Close() error
- func (c *Client) CloseSessions(ctx context.Context, sessionIDs []string, force bool) (*pb.CloseResponse, error)
- func (c *Client) CloseTabs(ctx context.Context, tabIDs []string, force bool) (*pb.CloseResponse, error)
- func (c *Client) CloseWindows(ctx context.Context, windowIDs []string, force bool) (*pb.CloseResponse, error)
- func (c *Client) ConfirmAlert(ctx context.Context, message, title string) (interface{}, error)
- func (c *Client) Connect(ctx context.Context) error
- func (c *Client) CopySelection(ctx context.Context, sessionID string) error
- func (c *Client) CreateTabWithOptions(ctx context.Context, profileName, windowID string, tabIndex uint32, ...) (*pb.CreateTabResponse, error)
- func (c *Client) CreateWindow(ctx context.Context, profileName string) (*pb.CreateTabResponse, error)
- func (c *Client) DeleteVariableWithScope(ctx context.Context, scope string, id string, name string) error
- func (c *Client) ExportColorPreset(ctx context.Context, name, filePath string) error
- func (c *Client) ExportKeyBindings(ctx context.Context, filename, profile string, global bool) error
- func (c *Client) FindText(ctx context.Context, sessionID, pattern string, ...) ([]*FindResult, error)
- func (c *Client) GetAllVariables(ctx context.Context, sessionID, tabID, windowID string) ([]*VariableInfo, error)
- func (c *Client) GetBroadcastDomains(ctx context.Context) ([]*BroadcastDomain, error)
- func (c *Client) GetBufferWithStyles(ctx context.Context, sessionID string, lines int32, includeStyles bool) (*pb.GetBufferResponse, error)
- func (c *Client) GetColorPreset(ctx context.Context, name string) (*ColorPreset, error)
- func (c *Client) GetContents(ctx context.Context, sessionID string, firstLine, numLines int32) (*pb.GetBufferResponse, error)
- func (c *Client) GetContentsWithStyles(ctx context.Context, sessionID string, firstLine, numLines int32, ...) (*pb.GetBufferResponse, error)
- func (c *Client) GetCursor(ctx context.Context, sessionID string) (*pb.Coord, error)
- func (c *Client) GetFocus(ctx context.Context) (*FocusInfo, error)
- func (c *Client) GetMultipleVariablesWithScope(ctx context.Context, scope string, id string, names []string) (map[string]string, error)
- func (c *Client) GetPreference(ctx context.Context, key string) (interface{}, error)
- func (c *Client) GetPreferences(ctx context.Context, keys []string) (map[string]interface{}, error)
- func (c *Client) GetProfile(ctx context.Context, profileName string) (map[string]interface{}, error)
- func (c *Client) GetProfileProperty(ctx context.Context, profileName, key string) (interface{}, error)
- func (c *Client) GetPrompt(ctx context.Context, sessionID string) (*pb.GetPromptResponse, error)
- func (c *Client) GetPromptByID(ctx context.Context, sessionID, promptID string) (*pb.GetPromptResponse, error)
- func (c *Client) GetScreenContents(ctx context.Context, sessionID string) (*pb.GetBufferResponse, error)
- func (c *Client) GetScreenContentsWithStyles(ctx context.Context, sessionID string, includeStyles bool) (*pb.GetBufferResponse, error)
- func (c *Client) GetSelection(ctx context.Context, sessionID string) (*pb.Selection, error)
- func (c *Client) GetSelectionText(ctx context.Context, sessionID string) (string, error)
- func (c *Client) GetSessionBadge(ctx context.Context, sessionID string) (string, error)
- func (c *Client) GetSessionProfileProperty(ctx context.Context, sessionID, key string) (interface{}, error)
- func (c *Client) GetSessionProperty(ctx context.Context, sessionID, property string) (string, error)
- func (c *Client) GetTabColor(ctx context.Context, tabID string) (red, green, blue float64, enabled bool, err error)
- func (c *Client) GetTabTitle(ctx context.Context, tabID string) (string, error)
- func (c *Client) GetVariable(ctx context.Context, sessionID, name string) (string, error)
- func (c *Client) GetVariableWithScope(ctx context.Context, scope string, id string, name string) (string, error)
- func (c *Client) GetWindowProperty(ctx context.Context, windowID, property string) (string, error)
- func (c *Client) GetWindowTitle(ctx context.Context, windowID string) (string, error)
- func (c *Client) HighlightText(ctx context.Context, sessionID, pattern string, ...) ([]*HighlightResult, error)
- func (c *Client) ImportColorPreset(ctx context.Context, name, filePath string) error
- func (c *Client) ImportKeyBindings(ctx context.Context, filename, profile string, global, merge bool) error
- func (c *Client) InjectData(ctx context.Context, sessionID string, data []byte) error
- func (c *Client) InputAlert(ctx context.Context, prompt, title, defaultText string, secure bool) (interface{}, error)
- func (c *Client) InvokeFunction(ctx context.Context, invocation string, sessionID, tabID, windowID *string, ...) (interface{}, error)
- func (c *Client) ListArrangements(ctx context.Context) (*pb.SavedArrangementResponse, error)
- func (c *Client) ListColorPresets(ctx context.Context) ([]string, error)
- func (c *Client) ListCustomControls(ctx context.Context) (interface{}, error)
- func (c *Client) ListKeyBindings(ctx context.Context, profile string, global bool) ([]interface{}, error)
- func (c *Client) ListProfiles(ctx context.Context, detailed bool) ([]string, error)
- func (c *Client) ListProfilesDetailed(ctx context.Context) ([]*pb.ListProfilesResponse_Profile, error)
- func (c *Client) ListProfilesSimple(ctx context.Context) ([]string, error)
- func (c *Client) ListPrompts(ctx context.Context, sessionID string) (*pb.ListPromptsResponse, error)
- func (c *Client) ListSessions(ctx context.Context) ([]*SessionInfo, error)
- func (c *Client) ListSessionsRaw(ctx context.Context) (*pb.ListSessionsResponse, error)
- func (c *Client) ListSessionsWithOptions(ctx context.Context, opts ListSessionsOptions) ([]*SessionInfo, error)
- func (c *Client) ListTmuxConnections(ctx context.Context) ([]*TmuxConnection, error)
- func (c *Client) ListVariablesWithScope(ctx context.Context, scope string, id string) ([]string, error)
- func (c *Client) ListWindows(ctx context.Context) ([]*WindowInfo, error)
- func (c *Client) MonitorLifecycle(ctx context.Context, sessionID string, follow bool) (interface{}, error)
- func (c *Client) MonitorSession(ctx context.Context, sessionID string, events []string) (<-chan *pb.PromptNotification, error)
- func (c *Client) MonitorVariable(ctx context.Context, scope, identifier, name string) (<-chan string, error)
- func (c *Client) MoveSession(ctx context.Context, sourceSessionID, destSessionID string, ...) error
- func (c *Client) OpenFilePanel(ctx context.Context, title, directory string, types []string, multiple bool) (interface{}, error)
- func (c *Client) PasteFromClipboardWithOptions(ctx context.Context, sessionID string, restoreFocus bool) error
- func (c *Client) PostNotification(ctx context.Context, message string) (interface{}, error)
- func (c *Client) ReadNotification(ctx context.Context) (*pb.ServerOriginatedMessage, error)
- func (c *Client) RegisterCustomControl(ctx context.Context, controlID, controlType, configStr string) (interface{}, error)
- func (c *Client) RegisterRPC(ctx context.Context, rpcName, sessionID string) (interface{}, error)
- func (c *Client) ReorderTabs(ctx context.Context, assignments map[string][]string) (*pb.ReorderTabsResponse, error)
- func (c *Client) ReplaceText(ctx context.Context, sessionID, pattern, replacement string, ...) ([]*ReplaceResult, error)
- func (c *Client) ResetSessionBadgeToProfile(ctx context.Context, sessionID string) error
- func (c *Client) ResolveSessionID(ctx context.Context, sessionID string) (string, error)
- func (c *Client) ResolveTabID(ctx context.Context, tabID string) (string, error)
- func (c *Client) ResolveWindowID(ctx context.Context, windowID string) (string, error)
- func (c *Client) RestartSession(ctx context.Context, sessionID string, onlyIfExited bool) (*pb.RestartSessionResponse, error)
- func (c *Client) RestoreArrangement(ctx context.Context, name string) (*pb.SavedArrangementResponse, error)
- func (c *Client) SaveArrangement(ctx context.Context, name string, windowID string) (*pb.SavedArrangementResponse, error)
- func (c *Client) SaveFilePanel(ctx context.Context, title, directory, filename string, types []string) (interface{}, error)
- func (c *Client) SendRequest(ctx context.Context, msg *pb.ClientOriginatedMessage) (*pb.ServerOriginatedMessage, error)
- func (c *Client) SendText(ctx context.Context, sessionID, text string) error
- func (c *Client) SendTmuxCommand(ctx context.Context, connectionID, command string) (string, error)
- func (c *Client) SetBroadcastDomains(ctx context.Context, domains []*BroadcastDomain) error
- func (c *Client) SetCursor(ctx context.Context, sessionID string, x int32, y int64) error
- func (c *Client) SetGridSize(ctx context.Context, sessionID string, width, height int32) error
- func (c *Client) SetPreference(ctx context.Context, key string, value interface{}) error
- func (c *Client) SetPreferences(ctx context.Context, prefs map[string]interface{}) error
- func (c *Client) SetProfileProperties(ctx context.Context, profileName string, properties map[string]interface{}) error
- func (c *Client) SetProfileProperty(ctx context.Context, profileName, key string, value interface{}) error
- func (c *Client) SetSelection(ctx context.Context, sessionID, start, end string) error
- func (c *Client) SetSelectionRange(ctx context.Context, sessionID string, startX int32, startY int64, endX int32, ...) error
- func (c *Client) SetSessionBadge(ctx context.Context, sessionID, badge string) error
- func (c *Client) SetSessionName(ctx context.Context, sessionID, name string) error
- func (c *Client) SetSessionProfileProperty(ctx context.Context, sessionID, key, value string) error
- func (c *Client) SetSessionProperty(ctx context.Context, sessionID, property, value string) error
- func (c *Client) SetTabColor(ctx context.Context, tabID string, red, green, blue float64) error
- func (c *Client) SetTabLayout(ctx context.Context, tabID string, root *pb.SplitTreeNode) (*pb.SetTabLayoutResponse, error)
- func (c *Client) SetTabTitle(ctx context.Context, tabID, title string) error
- func (c *Client) SetVariable(ctx context.Context, sessionID, name, value string) error
- func (c *Client) SetVariableWithScope(ctx context.Context, scope string, id string, name string, value string) error
- func (c *Client) SetWindowProperty(ctx context.Context, windowID, property, value string) error
- func (c *Client) SetWindowTitle(ctx context.Context, windowID, title string) error
- func (c *Client) ShowAlert(ctx context.Context, message, title string) (interface{}, error)
- func (c *Client) SplitPane(ctx context.Context, sessionID string, vertical bool, before bool, ...) (*pb.SplitPaneResponse, error)
- func (c *Client) SubscribeToGenericNotifications(ctx context.Context, notificationType string, sessionID string) (<-chan *pb.Notification, error)
- func (c *Client) SubscribeToKeystrokes(ctx context.Context, sessionID string) error
- func (c *Client) SubscribeToNotification(ctx context.Context, notificationType pb.NotificationType) error
- func (c *Client) SubscribeToScreenUpdates(ctx context.Context, sessionID string) error
- func (c *Client) TabContainsSession(node *pb.SplitTreeNode, sessionID string) bool
- func (c *Client) UnbindKey(ctx context.Context, key, profile string, global bool) error
- func (c *Client) UnregisterCustomControl(ctx context.Context, controlID string) (interface{}, error)
- func (c *Client) UnregisterRPC(ctx context.Context, rpcName, sessionID string) (interface{}, error)
- func (c *Client) UnsubscribeFromNotifications(ctx context.Context, notificationType, sessionID string) error
- func (c *Client) UpdateCustomControl(ctx context.Context, controlID string, data interface{}) (interface{}, error)
- type ColorPreset
- type ColorSetting
- type Dict
- type FindResult
- type FocusInfo
- type HighlightResult
- type ITerm2ColorPreset
- type KeyBinding
- type ListSessionsOptions
- type ReplaceResult
- type SessionInfo
- type TmuxConnection
- type Value
- type VariableInfo
- type WindowInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeSessionID ¶
NormalizeSessionID extracts the UUID part from ITERM_SESSION_ID format Handles both "w0t1p12:UUID" and "UUID" formats, returns just the UUID This ensures compatibility with both ITERM_SESSION_ID environment variable format and direct UUID usage throughout the it2 CLI.
func NotificationEventTypes ¶
func NotificationEventTypes() []string
NotificationEventTypes returns all supported notification event types that use the session parameter
func NotificationEventTypesAll ¶
func NotificationEventTypesAll() []string
NotificationEventTypesAll returns all notification event types
func NotificationEventTypesGlobal ¶
func NotificationEventTypesGlobal() []string
NotificationEventTypesGlobal returns notification types that ignore the session parameter
func NotificationTypeFromString ¶
func NotificationTypeFromString(event string) (pb.NotificationType, error)
NotificationTypeFromString converts a string to a NotificationType enum value
func NotificationTypeToString ¶
func NotificationTypeToString(notifType pb.NotificationType) string
NotificationTypeToString converts a NotificationType enum value to a string
Types ¶
type BroadcastDomain ¶
type BroadcastDomain struct {
SessionIds []string `json:"session_ids"`
}
BroadcastDomain represents a broadcast domain containing session IDs
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client manages a WebSocket connection to the iTerm2 API.
func (*Client) ActivateSession ¶
func (c *Client) ActivateSession(ctx context.Context, sessionID string, selectSession bool) (*pb.ActivateResponse, error)
ActivateSession activates and optionally selects a session with default options
func (*Client) ActivateSessionWithOptions ¶
func (c *Client) ActivateSessionWithOptions(ctx context.Context, sessionID string, selectSession, orderWindowFront, selectTab bool) (*pb.ActivateResponse, error)
ActivateSessionWithOptions activates a session with full control over activation behavior
func (*Client) ActivateTab ¶
func (c *Client) ActivateTab(ctx context.Context, tabID string, selectTab bool) (*pb.ActivateResponse, error)
ActivateTab activates and optionally selects a tab
func (*Client) ActivateWindow ¶
func (c *Client) ActivateWindow(ctx context.Context, windowID string, orderFront bool) (*pb.ActivateResponse, error)
ActivateWindow activates and optionally brings a window to the front
func (*Client) ApplyColorPreset ¶
ApplyColorPreset applies a color preset to a specific profile
func (*Client) BindKey ¶
func (c *Client) BindKey(ctx context.Context, key, action, profile string, global bool, description string) error
BindKey creates or updates a keyboard binding
func (*Client) ClearBuffer ¶
func (c *Client) ClearBuffer(ctx context.Context, sessionID string, scrollback, screenOnly bool) error
ClearBuffer clears the screen buffer and/or scrollback history
func (*Client) ClearHighlights ¶
ClearHighlights removes all text highlights
func (*Client) ClearSelection ¶
ClearSelection clears the current text selection for a session
func (*Client) ClearSessionBadge ¶
ClearSessionBadge clears the session badge by setting it to empty string
func (*Client) ClearTabColor ¶
ClearTabColor clears the tab color by deleting the session-specific overrides
func (*Client) ClearTabTitle ¶
ClearTabTitle clears the tab title by deleting the user.title variable
func (*Client) ClearWindowTitle ¶
ClearWindowTitle clears the window title by deleting the user.title variable
func (*Client) CloseSessions ¶
func (c *Client) CloseSessions(ctx context.Context, sessionIDs []string, force bool) (*pb.CloseResponse, error)
CloseSessions closes one or more sessions
func (*Client) CloseTabs ¶
func (c *Client) CloseTabs(ctx context.Context, tabIDs []string, force bool) (*pb.CloseResponse, error)
CloseTabs closes one or more tabs
func (*Client) CloseWindows ¶
func (c *Client) CloseWindows(ctx context.Context, windowIDs []string, force bool) (*pb.CloseResponse, error)
CloseWindows closes one or more windows
func (*Client) ConfirmAlert ¶
ConfirmAlert displays a confirmation alert
func (*Client) CopySelection ¶
CopySelection copies the current selection to clipboard
func (*Client) CreateTabWithOptions ¶
func (c *Client) CreateTabWithOptions(ctx context.Context, profileName, windowID string, tabIndex uint32, command string) (*pb.CreateTabResponse, error)
CreateTabWithOptions creates a new tab with advanced options
func (*Client) CreateWindow ¶
func (c *Client) CreateWindow(ctx context.Context, profileName string) (*pb.CreateTabResponse, error)
CreateWindow creates a new iTerm2 window
func (*Client) DeleteVariableWithScope ¶
func (c *Client) DeleteVariableWithScope(ctx context.Context, scope string, id string, name string) error
DeleteVariableWithScope deletes/unsets a variable with explicit scope control
func (*Client) ExportColorPreset ¶
ExportColorPreset exports a color preset to an .itermcolors file
func (*Client) ExportKeyBindings ¶
func (c *Client) ExportKeyBindings(ctx context.Context, filename, profile string, global bool) error
ExportKeyBindings exports keyboard bindings to a file
func (*Client) FindText ¶
func (c *Client) FindText(ctx context.Context, sessionID, pattern string, regex, caseSensitive, wholeWord bool, maxResults int32) ([]*FindResult, error)
FindText searches for text patterns in the session buffer
func (*Client) GetAllVariables ¶
func (c *Client) GetAllVariables(ctx context.Context, sessionID, tabID, windowID string) ([]*VariableInfo, error)
GetAllVariables gets all variables from all scopes (requires session/tab/window IDs)
func (*Client) GetBroadcastDomains ¶
func (c *Client) GetBroadcastDomains(ctx context.Context) ([]*BroadcastDomain, error)
GetBroadcastDomains returns the current broadcast domains
func (*Client) GetBufferWithStyles ¶
func (c *Client) GetBufferWithStyles(ctx context.Context, sessionID string, lines int32, includeStyles bool) (*pb.GetBufferResponse, error)
GetBufferWithStyles retrieves the buffer contents of a session with optional style information
func (*Client) GetColorPreset ¶
GetColorPreset retrieves the details of a specific color preset
func (*Client) GetContents ¶
func (c *Client) GetContents(ctx context.Context, sessionID string, firstLine, numLines int32) (*pb.GetBufferResponse, error)
GetContents retrieves specific line ranges from a session buffer
func (*Client) GetContentsWithStyles ¶
func (c *Client) GetContentsWithStyles(ctx context.Context, sessionID string, firstLine, numLines int32, includeStyles bool) (*pb.GetBufferResponse, error)
GetContentsWithStyles retrieves specific line ranges from a session buffer with optional style information
func (*Client) GetMultipleVariablesWithScope ¶
func (c *Client) GetMultipleVariablesWithScope(ctx context.Context, scope string, id string, names []string) (map[string]string, error)
GetMultipleVariablesWithScope gets multiple variable values in a single API call. Returns a map of variable name to value. Variables that don't exist are omitted.
func (*Client) GetPreference ¶
GetPreference gets a single application preference
func (*Client) GetPreferences ¶
GetPreferences gets multiple application preferences
func (*Client) GetProfile ¶
func (c *Client) GetProfile(ctx context.Context, profileName string) (map[string]interface{}, error)
GetProfile gets all properties for a specific profile by name
func (*Client) GetProfileProperty ¶
func (c *Client) GetProfileProperty(ctx context.Context, profileName, key string) (interface{}, error)
GetProfileProperty gets a specific property for a profile by name Deprecated: Use GetProfile to get all properties at once
func (*Client) GetPrompt ¶
GetPrompt gets information about prompts in a session (requires Shell Integration)
func (*Client) GetPromptByID ¶
func (c *Client) GetPromptByID(ctx context.Context, sessionID, promptID string) (*pb.GetPromptResponse, error)
GetPromptByID gets specific prompt information by unique ID
func (*Client) GetScreenContents ¶
func (c *Client) GetScreenContents(ctx context.Context, sessionID string) (*pb.GetBufferResponse, error)
GetScreenContents retrieves the current screen contents of a session
func (*Client) GetScreenContentsWithStyles ¶
func (c *Client) GetScreenContentsWithStyles(ctx context.Context, sessionID string, includeStyles bool) (*pb.GetBufferResponse, error)
GetScreenContentsWithStyles retrieves the current screen contents of a session with optional style information
func (*Client) GetSelection ¶
GetSelection gets the current text selection for a session
func (*Client) GetSelectionText ¶
GetSelectionText gets the text content of the current selection
func (*Client) GetSessionBadge ¶
GetSessionBadge gets the session badge from the "Badge Text" profile property
func (*Client) GetSessionProfileProperty ¶
func (c *Client) GetSessionProfileProperty(ctx context.Context, sessionID, key string) (interface{}, error)
GetSessionProfileProperty gets a profile property from a specific sessions copy of the profile
func (*Client) GetSessionProperty ¶
func (c *Client) GetSessionProperty(ctx context.Context, sessionID, property string) (string, error)
GetSessionProperty gets a session property value
func (*Client) GetTabColor ¶
func (c *Client) GetTabColor(ctx context.Context, tabID string) (red, green, blue float64, enabled bool, err error)
GetTabColor retrieves the current tab color from session-specific profile properties
func (*Client) GetTabTitle ¶
GetTabTitle gets the tab title from the "user.title" variable in tab scope
func (*Client) GetVariable ¶
GetVariable gets the value of a variable (backward compatibility) Deprecated: Use GetVariableWithScope instead
func (*Client) GetVariableWithScope ¶
func (c *Client) GetVariableWithScope(ctx context.Context, scope string, id string, name string) (string, error)
GetVariableWithScope gets a variable value with explicit scope control
func (*Client) GetWindowProperty ¶
GetWindowProperty retrieves a property value for a window
func (*Client) GetWindowTitle ¶
GetWindowTitle gets the window title from the titleOverride variable
func (*Client) HighlightText ¶
func (c *Client) HighlightText(ctx context.Context, sessionID, pattern string, regex, caseSensitive, wholeWord bool, color, background string, duration int32) ([]*HighlightResult, error)
HighlightText creates temporary highlighting for text patterns
func (*Client) ImportColorPreset ¶
ImportColorPreset imports a color preset from an .itermcolors file
func (*Client) ImportKeyBindings ¶
func (c *Client) ImportKeyBindings(ctx context.Context, filename, profile string, global, merge bool) error
ImportKeyBindings imports keyboard bindings from a file
func (*Client) InjectData ¶
InjectData injects data into a session as if it came from the program
func (*Client) InputAlert ¶
func (c *Client) InputAlert(ctx context.Context, prompt, title, defaultText string, secure bool) (interface{}, error)
InputAlert displays an input alert
func (*Client) InvokeFunction ¶
func (c *Client) InvokeFunction(ctx context.Context, invocation string, sessionID, tabID, windowID *string, timeout float64) (interface{}, error)
InvokeFunction invokes a function in iTerm2, possibly as a method call on an object
func (*Client) ListArrangements ¶
ListArrangements lists all saved arrangements
func (*Client) ListColorPresets ¶
ListColorPresets returns a list of available color preset names
func (*Client) ListCustomControls ¶
ListCustomControls lists custom controls (placeholder)
func (*Client) ListKeyBindings ¶
func (c *Client) ListKeyBindings(ctx context.Context, profile string, global bool) ([]interface{}, error)
ListKeyBindings lists all keyboard bindings for a profile or globally
func (*Client) ListProfiles ¶
ListProfiles returns profile names, optionally with detailed information This is the main method that should be used
func (*Client) ListProfilesDetailed ¶
func (c *Client) ListProfilesDetailed(ctx context.Context) ([]*pb.ListProfilesResponse_Profile, error)
ListProfilesDetailed returns detailed profile information
func (*Client) ListProfilesSimple ¶
ListProfilesSimple returns just profile names
func (*Client) ListPrompts ¶
func (c *Client) ListPrompts(ctx context.Context, sessionID string) (*pb.ListPromptsResponse, error)
ListPrompts lists historical prompts for a session
func (*Client) ListSessions ¶
func (c *Client) ListSessions(ctx context.Context) ([]*SessionInfo, error)
func (*Client) ListSessionsRaw ¶
ListSessionsRaw returns the raw protobuf response with full window/tab tree
func (*Client) ListSessionsWithOptions ¶
func (c *Client) ListSessionsWithOptions(ctx context.Context, opts ListSessionsOptions) ([]*SessionInfo, error)
ListSessionsWithOptions returns sessions using the provided options.
func (*Client) ListTmuxConnections ¶
func (c *Client) ListTmuxConnections(ctx context.Context) ([]*TmuxConnection, error)
ListTmuxConnections returns all tmux integration connections
func (*Client) ListVariablesWithScope ¶
func (c *Client) ListVariablesWithScope(ctx context.Context, scope string, id string) ([]string, error)
ListVariablesWithScope lists all variables in a specific scope
func (*Client) ListWindows ¶
func (c *Client) ListWindows(ctx context.Context) ([]*WindowInfo, error)
ListWindows gets a list of all windows with their information
func (*Client) MonitorLifecycle ¶
func (c *Client) MonitorLifecycle(ctx context.Context, sessionID string, follow bool) (interface{}, error)
MonitorLifecycle monitors lifecycle events (placeholder)
func (*Client) MonitorSession ¶
func (c *Client) MonitorSession(ctx context.Context, sessionID string, events []string) (<-chan *pb.PromptNotification, error)
MonitorSession starts monitoring a session for prompt events
func (*Client) MonitorVariable ¶
func (c *Client) MonitorVariable(ctx context.Context, scope, identifier, name string) (<-chan string, error)
MonitorVariable starts monitoring a variable for changes using VariableMonitorRequest
func (*Client) MoveSession ¶
func (c *Client) MoveSession(ctx context.Context, sourceSessionID, destSessionID string, vertical, before bool) error
MoveSession moves a session to be a split pane next to another session using iTerm2's built-in iterm2.move_session function.
Parameters:
- sourceSessionID: The session to move
- destSessionID: The destination session to split
- vertical: If true, split destination vertically; if false, horizontally
- before: If true, place source before/above destination; if false, after/below
The function will fail if:
- Either session ID is invalid
- Sessions are not compatible (e.g., tmux vs non-tmux)
- Either session has no tab
- Either session is locked
- Panes are maximized (will auto-unmaximize)
func (*Client) OpenFilePanel ¶
func (c *Client) OpenFilePanel(ctx context.Context, title, directory string, types []string, multiple bool) (interface{}, error)
OpenFilePanel opens a file selection panel
func (*Client) PasteFromClipboardWithOptions ¶
func (c *Client) PasteFromClipboardWithOptions(ctx context.Context, sessionID string, restoreFocus bool) error
PasteFromClipboardWithOptions pastes clipboard content with optional focus restoration
func (*Client) PostNotification ¶
PostNotification posts a notification to macOS Notification Center
func (*Client) ReadNotification ¶
ReadNotification reads the next notification from the message stream
func (*Client) RegisterCustomControl ¶
func (c *Client) RegisterCustomControl(ctx context.Context, controlID, controlType, configStr string) (interface{}, error)
RegisterCustomControl registers a custom control (placeholder)
func (*Client) RegisterRPC ¶
RegisterRPC registers an RPC handler (placeholder)
func (*Client) ReorderTabs ¶
func (c *Client) ReorderTabs(ctx context.Context, assignments map[string][]string) (*pb.ReorderTabsResponse, error)
ReorderTabs reorders tabs within windows
func (*Client) ReplaceText ¶
func (c *Client) ReplaceText(ctx context.Context, sessionID, pattern, replacement string, regex, caseSensitive, wholeWord bool, maxReplacements int32, confirm bool) ([]*ReplaceResult, error)
ReplaceText replaces text patterns in the session buffer
func (*Client) ResetSessionBadgeToProfile ¶
ResetSessionBadgeToProfile copies the profile's badge to the session badge
func (*Client) ResolveSessionID ¶
ResolveSessionID resolves a session ID with intelligent fallback and prefix matching 1. If sessionID is empty, uses $ITERM_SESSION_ID environment variable 2. Normalizes the session ID format (removes ITERM_SESSION_ID prefix if present) 3. Expands short session ID prefixes to full IDs by matching against available sessions
func (*Client) ResolveTabID ¶
ResolveTabID resolves a tab ID with intelligent fallback and prefix matching 1. If tabID is empty, finds the tab ID of the current session 2. Supports prefix matching for tab IDs (4+ chars minimum) 3. Returns the tab ID as-is if it's a complete match
func (*Client) ResolveWindowID ¶
ResolveWindowID resolves a window ID with intelligent fallback and prefix matching 1. If windowID is empty, finds the window ID of the current session 2. Supports prefix matching for window IDs (4+ chars minimum) 3. Returns the window ID as-is if it's a complete match
func (*Client) RestartSession ¶
func (c *Client) RestartSession(ctx context.Context, sessionID string, onlyIfExited bool) (*pb.RestartSessionResponse, error)
RestartSession restarts a session
func (*Client) RestoreArrangement ¶
func (c *Client) RestoreArrangement(ctx context.Context, name string) (*pb.SavedArrangementResponse, error)
RestoreArrangement restores a saved window layout
func (*Client) SaveArrangement ¶
func (c *Client) SaveArrangement(ctx context.Context, name string, windowID string) (*pb.SavedArrangementResponse, error)
SaveArrangement saves the current window layout with a given name
func (*Client) SaveFilePanel ¶
func (c *Client) SaveFilePanel(ctx context.Context, title, directory, filename string, types []string) (interface{}, error)
SaveFilePanel opens a file save panel
func (*Client) SendRequest ¶
func (c *Client) SendRequest(ctx context.Context, msg *pb.ClientOriginatedMessage) (*pb.ServerOriginatedMessage, error)
func (*Client) SendText ¶
SendText sends text to a session as if typed by the user, automatically splitting large text into 4KB chunks
func (*Client) SendTmuxCommand ¶
SendTmuxCommand sends a command to a tmux connection and returns the output
func (*Client) SetBroadcastDomains ¶
func (c *Client) SetBroadcastDomains(ctx context.Context, domains []*BroadcastDomain) error
SetBroadcastDomains sets the broadcast domains
func (*Client) SetGridSize ¶
SetGridSize sets the terminal grid size for a session
func (*Client) SetPreference ¶
SetPreference sets a single application preference
func (*Client) SetPreferences ¶
SetPreferences sets multiple application preferences
func (*Client) SetProfileProperties ¶
func (c *Client) SetProfileProperties(ctx context.Context, profileName string, properties map[string]interface{}) error
SetProfileProperties sets multiple properties for a profile efficiently This avoids repeated GUID lookups by doing it once upfront
func (*Client) SetProfileProperty ¶
func (c *Client) SetProfileProperty(ctx context.Context, profileName, key string, value interface{}) error
SetProfileProperty sets a specific property for a profile by name
func (*Client) SetSelection ¶
SetSelection sets text selection for a session using start/end position strings Deprecated: Use SetSelectionRange instead for explicit coordinate handling
func (*Client) SetSelectionRange ¶
func (c *Client) SetSelectionRange(ctx context.Context, sessionID string, startX int32, startY int64, endX int32, endY int64, mode string) error
SetSelectionRange sets selection using explicit coordinates
func (*Client) SetSessionBadge ¶
SetSessionBadge sets the session badge by setting the "Badge Text" profile property
func (*Client) SetSessionName ¶
SetSessionName sets the session name by setting the Name profile property
func (*Client) SetSessionProfileProperty ¶
SetSessionProfileProperty sets a profile property on a specific sessions copy of the profile without modifying the underlying profile. This enables per-session customization.
func (*Client) SetSessionProperty ¶
SetSessionProperty sets a session property value
func (*Client) SetTabColor ¶
SetTabColor sets the tab color using session-specific profile properties The color is specified as normalized RGB values (0.0-1.0)
func (*Client) SetTabLayout ¶
func (c *Client) SetTabLayout(ctx context.Context, tabID string, root *pb.SplitTreeNode) (*pb.SetTabLayoutResponse, error)
SetTabLayout sets the layout of a tab
func (*Client) SetTabTitle ¶
SetTabTitle sets the tab title by setting the "user.title" variable in tab scope
func (*Client) SetVariable ¶
SetVariable sets the value of a variable (backward compatibility) Deprecated: Use SetVariableWithScope instead
func (*Client) SetVariableWithScope ¶
func (c *Client) SetVariableWithScope(ctx context.Context, scope string, id string, name string, value string) error
SetVariableWithScope sets a variable value with explicit scope control
func (*Client) SetWindowProperty ¶
SetWindowProperty sets a property value for a window
func (*Client) SetWindowTitle ¶
SetWindowTitle sets the window title by setting the user.title variable
func (*Client) SplitPane ¶
func (c *Client) SplitPane(ctx context.Context, sessionID string, vertical bool, before bool, profileName string, customProps []*pb.ProfileProperty) (*pb.SplitPaneResponse, error)
SplitPane splits a session pane vertically or horizontally
func (*Client) SubscribeToGenericNotifications ¶
func (c *Client) SubscribeToGenericNotifications(ctx context.Context, notificationType string, sessionID string) (<-chan *pb.Notification, error)
SubscribeToGenericNotifications subscribes to iTerm2 notifications and returns raw notification objects This is a simplified version that returns the raw notification for the caller to process
func (*Client) SubscribeToKeystrokes ¶
SubscribeToKeystrokes subscribes to keystroke notifications for a session
func (*Client) SubscribeToNotification ¶
func (c *Client) SubscribeToNotification(ctx context.Context, notificationType pb.NotificationType) error
InvokeMethod invokes a method on an iTerm2 object (convenience wrapper around InvokeFunction) SubscribeToNotification subscribes to a specific notification type
func (*Client) SubscribeToScreenUpdates ¶
SubscribeToScreenUpdates subscribes to screen update notifications for a session
func (*Client) TabContainsSession ¶
func (c *Client) TabContainsSession(node *pb.SplitTreeNode, sessionID string) bool
TabContainsSession recursively checks if a tab tree contains the given session ID
func (*Client) UnregisterCustomControl ¶
func (c *Client) UnregisterCustomControl(ctx context.Context, controlID string) (interface{}, error)
UnregisterCustomControl unregisters a custom control (placeholder)
func (*Client) UnregisterRPC ¶
UnregisterRPC unregisters an RPC handler (placeholder)
type ColorPreset ¶
type ColorPreset struct {
Name string
Settings map[string]*ColorSetting
}
ColorPreset represents a color preset with its settings
type ColorSetting ¶
ColorSetting represents a single color setting
type FindResult ¶
type FindResult struct {
Line int64 `json:"line"`
Column int32 `json:"column"`
Text string `json:"text"`
Context string `json:"context"`
LineText string `json:"line_text"`
}
FindResult represents a text search result
type FocusInfo ¶
type FocusInfo struct {
ApplicationFocused bool `json:"application_focused"`
WindowId string `json:"window_id,omitempty"`
TabId string `json:"tab_id,omitempty"`
SessionId string `json:"session_id,omitempty"`
}
FocusInfo represents current focus state
type HighlightResult ¶
type HighlightResult struct {
Line int64 `json:"line"`
Column int32 `json:"column"`
Text string `json:"text"`
Color string `json:"color"`
Duration int32 `json:"duration"`
HighlightID string `json:"highlight_id"`
}
HighlightResult represents a text highlighting result
type ITerm2ColorPreset ¶
ITerm2ColorPreset represents the structure of an .itermcolors file
type KeyBinding ¶
type KeyBinding struct {
Key string `json:"key"`
Action string `json:"action"`
Profile string `json:"profile,omitempty"`
Global bool `json:"global,omitempty"`
Description string `json:"description,omitempty"`
}
KeyBinding represents a keyboard binding configuration
type ListSessionsOptions ¶
type ListSessionsOptions struct {
IncludeBuried bool
IncludeJobInfo bool // populate process info (pgrep, API calls per session); expensive with many sessions
}
ListSessionsOptions controls optional session listing behaviour.
type ReplaceResult ¶
type ReplaceResult struct {
Line int64 `json:"line"`
Column int32 `json:"column"`
OriginalText string `json:"original_text"`
NewText string `json:"new_text"`
Success bool `json:"success"`
}
ReplaceResult represents a text replacement result
type SessionInfo ¶
type SessionInfo struct {
SessionID string
ShortID string // First 8 characters of SessionID for easier reference
ParentSessionID string // Parent session ID if this is a split pane
SplitVertical *bool // Direction of split from parent (nil if no parent, true=vertical, false=horizontal)
WindowID string
WindowNumber int32 // iTerm2 window index
TabID string
WindowTitle string
TabTitle string
SessionName string
PluginData map[string]interface{} // Additional data from plugins
Frame *pb.Frame // Frame coordinates if available
GridSize *pb.Size // Grid size if available
// Command information from shell integration
CurrentCommand string // Current command from GetPrompt
ExitCode uint32 // Last command exit status
PromptState string // Shell prompt state (AT_COMMAND_LINE, IN_COMMAND, etc.)
CommandCount int32 // Number of commands executed
ShellPID int32 // Process ID of the shell
JobPID int32 // Process ID of current job
ProcessName string // Name of the primary running process (from JobPID)
WorkingDirectory string // Current working directory from session.path
}
type TmuxConnection ¶
type TmuxConnection struct {
ConnectionId string `json:"connection_id"`
OwningSessionId string `json:"owning_session_id"`
}
TmuxConnection represents a tmux integration connection
type Value ¶
type Value struct {
Keys []string `xml:"key"`
Reals []float64 `xml:"real"`
Strings []string `xml:"string"`
}
Value represents a dictionary value in plist
type VariableInfo ¶
type VariableInfo struct {
Name string `json:"name"`
Value string `json:"value"`
Scope string `json:"scope"`
ID string `json:"id,omitempty"`
}
VariableInfo represents variable information for listing
type WindowInfo ¶
type WindowInfo struct {
WindowID string `json:"window_id"`
WindowNumber int32 `json:"window_number"` // iTerm2 window index
Title string `json:"title,omitempty"`
Frame string `json:"frame,omitempty"`
Fullscreen string `json:"fullscreen,omitempty"`
Miniaturized string `json:"miniaturized,omitempty"`
TabCount int `json:"tab_count"`
SessionCount int `json:"session_count,omitempty"`
PluginData map[string]interface{} `json:"plugin_data,omitempty"`
}
WindowInfo represents window information for client functions