Documentation
¶
Index ¶
- Constants
- 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) Resize(cols, rows int)
- func (c *Client) RunCommand(sessionID, cmd string) error
- func (c *Client) SendText(sessionID, text string) error
Constants ¶
const ( // DefaultCols is the default terminal width when not configured. DefaultCols = 120 // DefaultRows is the default terminal height when not configured. DefaultRows = 40 )
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 built-in PTY management. Each agent session runs in its own pseudo-terminal with a vt10x emulator.
func (*Client) Available ¶
Available always returns nil since the PTY backend has no external dependencies.
func (*Client) Close ¶
func (c *Client) Close()
Close cleans up all sessions (both live and exited).
func (*Client) FocusSession ¶
FocusSession is a no-op for the PTY backend. The TUI handles display by switching to the embedded terminal view.
func (*Client) ListSessions ¶
ListSessions returns all active (non-exited) sessions. Exited sessions are cleaned up (fd closed, process reaped) but kept in the map so they remain addressable for ReadScreen until Close().
func (*Client) MonitorOutput ¶
MonitorOutput is not supported by the PTY backend. Screen reads every 3s are the primary status detection mechanism.
func (*Client) NewSession ¶
NewSession spawns a new shell in a PTY and returns its session ID.
func (*Client) ReadScreen ¶
ReadScreen returns the last N lines from the session's vt10x screen buffer.
func (*Client) RunCommand ¶
RunCommand sends a command string followed by a newline to the session's PTY.