Documentation
¶
Overview ¶
Package mock is a simulated terminal (a terminal emulator if you will!) that is intended to be used for testing tcell. As this package is for internal testing of tcell, it carries no stability promise.
Index ¶
- type Cell
- type MockTty
- func (mt *MockTty) Close() error
- func (mt *MockTty) Drain() error
- func (mt *MockTty) NotifyResize(rq chan<- bool)
- func (mt *MockTty) Read(b []byte) (int, error)
- func (mt *MockTty) Reset()
- func (mt *MockTty) Start() error
- func (mt *MockTty) Stop() error
- func (mt *MockTty) WindowSize() (tcell.WindowSize, error)
- func (mt *MockTty) Write(b []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cell ¶
type Cell struct {
C []rune // Content, for now only a single rune is supported
Fg color.Color
Bg color.Color
Attr tcell.AttrMask
Width int // Display width of C.
}
Cell is a representation of a display cell.
type MockTty ¶
type MockTty struct {
Cells []Cell // Content of cells
Rows vt.Row
Cols vt.Col
Fg color.Color
Bg color.Color
Attr tcell.AttrMask
X vt.Col // cursor horizontal position
Y vt.Row // cursor vertical position
Bells int // incremented each time the bell is sounded
ReadQ chan any // contents of stdin
WriteQ chan any // contents of stdout
PrimaryAttributes string // Primary device attributes, response to CSI-c
SecondaryAttributes string // Secondary device attributes, response to CSI-c
ExtendedAttributes string // Extended attributes (term name, etc.) response to CSI > q
PrivateModes map[vt.PrivateMode]vt.ModeStatus
// contains filtered or unexported fields
}
MockTty is a mock terminal device.
func (*MockTty) NotifyResize ¶
func (*MockTty) Reset ¶
func (mt *MockTty) Reset()
Reset is not part of the TTY interface, and is for testing.
func (*MockTty) WindowSize ¶
func (mt *MockTty) WindowSize() (tcell.WindowSize, error)
Click to show internal directories.
Click to hide internal directories.