Documentation
¶
Overview ¶
Package ansi provides shared ANSI/DEC terminal emulation for concrete terminal profiles.
Index ¶
- type Profile
- type Terminal
- func (t *Terminal) DrainEvents() []tuicast.TerminalEvent
- func (t *Terminal) EncodeKey(key tuicast.Key) ([]byte, error)
- func (t *Terminal) EncodeKeyPress(press tuicast.KeyPress) ([]byte, error)
- func (t *Terminal) Profile() tuicast.TerminalProfile
- func (t *Terminal) Resize(width, height int) error
- func (t *Terminal) Revision() uint64
- func (t *Terminal) SetAnswerback(answerback string) error
- func (t *Terminal) Snapshot() tuicast.Screen
- func (t *Terminal) Write(data []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
Terminal is the shared ANSI/DEC emulation engine.
func (*Terminal) DrainEvents ¶
func (t *Terminal) DrainEvents() []tuicast.TerminalEvent
DrainEvents returns and clears terminal control events produced by Write.
func (*Terminal) EncodeKeyPress ¶
EncodeKeyPress returns the input sequence for a key and its modifiers.
func (*Terminal) Profile ¶
func (t *Terminal) Profile() tuicast.TerminalProfile
Profile returns the terminal behavior being emulated.
func (*Terminal) Resize ¶
Resize changes the terminal dimensions while preserving each buffer's overlapping upper-left region.
func (*Terminal) Revision ¶ added in v0.2.0
Revision returns the current screen revision without copying the screen.
func (*Terminal) SetAnswerback ¶
SetAnswerback configures the printable response to an ENQ control. DEC terminals limit the answerback message to 20 bytes.