Documentation ¶
Overview ¶
Package faketerm is a fake implementation of the terminal for the use in tests.
Index ¶
- func Diff(want, got *Terminal) string
- type Option
- type Terminal
- func (t *Terminal) Area() image.Rectangle
- func (t *Terminal) BackBuffer() cell.Buffer
- func (t *Terminal) Clear(opts ...cell.Option) error
- func (t *Terminal) Close()
- func (t *Terminal) Event(ctx context.Context) terminalapi.Event
- func (t *Terminal) Flush() error
- func (t *Terminal) HideCursor()
- func (t *Terminal) Resize(size image.Point) error
- func (t *Terminal) SetCell(p image.Point, r rune, opts ...cell.Option) error
- func (t *Terminal) SetCursor(p image.Point)
- func (t *Terminal) Size() image.Point
- func (t *Terminal) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is used to provide options.
func WithEventQueue ¶
func WithEventQueue(eq *eventqueue.Unbound) Option
WithEventQueue provides a queue of events. One event will be consumed from the queue each time Event() is called. If not provided, Event() returns an error on each call.
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
Terminal is a fake terminal. This implementation is thread-safe.
func (*Terminal) BackBuffer ¶
BackBuffer returns the back buffer of the fake terminal.
func (*Terminal) Close ¶
func (t *Terminal) Close()
Close closes the terminal. This is a no-op on the fake terminal.
func (*Terminal) Event ¶
func (t *Terminal) Event(ctx context.Context) terminalapi.Event
Event implements terminalapi.Terminal.Event.
func (*Terminal) HideCursor ¶
func (t *Terminal) HideCursor()
HideCursor implements terminalapi.Terminal.HideCursor.
func (*Terminal) Resize ¶
Resize resizes the terminal to the provided size. This also clears the internal buffer.