Documentation
¶
Index ¶
- type Client
- type Screen
- func (s *Screen) AttachClient(c *Client)
- func (s *Screen) CursorPos() (rows, columns int)
- func (s *Screen) GetHistoryAsANSI() []byte
- func (s *Screen) GetScreenAsANSI() []byte
- func (s *Screen) Read(p []byte) (n int, err error)
- func (s *Screen) Resize(rows, columns int)
- func (s *Screen) Write(p []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.0.20
type Client struct {
SessionID string `json:"session_id"`
// contains filtered or unexported fields
}
type Screen ¶
type Screen struct {
Columns int `json:"columns"`
Rows int `json:"rows"`
Clients []*Client `json:"-"`
Stream *stream.Stream `json:"-"`
// contains filtered or unexported fields
}
Screen broadcasts a single terminal to every attached client. It keeps an authoritative in-memory terminal emulator so new clients can be brought to the current state.
mx guards Clients, Rows, and Columns. The emulator (mt) and the broadcast Stream are internally synchronized, so they are used without holding mx. The lock is never held while sending to a client.
func (*Screen) AttachClient ¶ added in v0.0.20
AttachClient attaches a client and brings it to the current screen state.
func (*Screen) GetHistoryAsANSI ¶ added in v0.0.28
GetHistoryAsANSI returns the lines above the visible screen as ANSI.
func (*Screen) GetScreenAsANSI ¶
GetScreenAsANSI returns the current screen content as ANSI.