Documentation
¶
Overview ¶
Package ptybackend adapts Relayer's established PTY session manager to the context-aware terminal.Backend contract.
Index ¶
- func IsClosed(err error) bool
- type Manager
- func (m *Manager) AnsiOutput(id string) (string, error)
- func (m *Manager) AttachCommand(context.Context, terminal.SessionID) (*exec.Cmd, error)
- func (m *Manager) BeginShutdown()
- func (m *Manager) Close(ctx context.Context) error
- func (m *Manager) Context() context.Context
- func (m *Manager) Name() string
- func (m *Manager) Output(id string) (string, error)
- func (m *Manager) PendingEvent(ctx context.Context, id terminal.SessionID) (*adapters.Event, error)
- func (m *Manager) Remove(ctx context.Context, id terminal.SessionID) error
- func (m *Manager) Resize(ctx context.Context, id terminal.SessionID, size terminal.Size) error
- func (m *Manager) Send(ctx context.Context, id terminal.SessionID, data []byte) error
- func (m *Manager) SendEvent(ctx context.Context, id terminal.SessionID, eventID string, data []byte) error
- func (m *Manager) SendLine(ctx context.Context, id terminal.SessionID, line string) error
- func (m *Manager) SendRaw(ctx context.Context, id terminal.SessionID, data []byte) error
- func (m *Manager) SetRecorder(recorder terminal.Recorder)
- func (m *Manager) Snapshot(ctx context.Context, id terminal.SessionID) (terminal.Snapshot, error)
- func (m *Manager) Start(ctx context.Context, spec agent.Spec, size terminal.Size) (terminal.Info, error)
- func (m *Manager) Stop(ctx context.Context, id terminal.SessionID) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewWithRegistry ¶
func NewWithRegistry( parent context.Context, events chan<- session.Event, registry *adapters.Registry, ringCapacity int, ) (*Manager, error)
NewWithRegistry constructs a PTY backend using the application adapter registry. New remains the source-compatible legacy-pattern wrapper.
func (*Manager) AnsiOutput ¶
AnsiOutput returns the processor's in-memory ring retaining ANSI escape codes.
func (*Manager) AttachCommand ¶
func (*Manager) BeginShutdown ¶
func (m *Manager) BeginShutdown()
BeginShutdown is intentionally non-blocking so Bubble Tea can quit before Close joins process and reader goroutines.
func (*Manager) PendingEvent ¶
PendingEvent returns cached adapter state without performing terminal I/O.
func (*Manager) Remove ¶ added in v0.4.0
Remove releases one fully stopped session identity so Start can register it again. The inner manager proves the process was reaped before forgetting it; a live process keeps the identity locked with terminal.ErrSessionRunning.
func (*Manager) SendEvent ¶
func (m *Manager) SendEvent(ctx context.Context, id terminal.SessionID, eventID string, data []byte) error
SendEvent resolves one pending adapter event and transmits data exactly as supplied. An empty eventID preserves the historical Send behavior.
func (*Manager) SendLine ¶
SendLine uses the Processor's ordinary-input CAS. It never falls back to SendDataForEvent and therefore cannot resolve or acknowledge a prompt.
func (*Manager) SendRaw ¶ added in v0.6.0
SendRaw writes raw terminal input bytes directly to the PTY device for interactive streaming.
func (*Manager) SetRecorder ¶ added in v0.7.0
SetRecorder forwards the transcript recorder to the owned session manager, which is where the PTY bytes actually pass.