Documentation
¶
Index ¶
- Constants
- type Device
- type State
- type VT
- func (t *VT) AttachTo(cons console.Device)
- func (t *VT) CursorPosition() (uint32, uint32)
- func (t *VT) DriverInit(_ io.Writer) *kernel.Error
- func (t *VT) DriverName() string
- func (t *VT) DriverVersion() (uint16, uint16, uint16)
- func (t *VT) SetCursorPosition(x, y uint32)
- func (t *VT) SetState(newState State)
- func (t *VT) State() State
- func (t *VT) Write(data []byte) (int, error)
- func (t *VT) WriteByte(b byte) error
Constants ¶
const ( // DefaultScrollback defines the terminal scrollback in lines. DefaultScrollback = 80 // DefaultTabWidth defines the number of spaces that tabs expand to. DefaultTabWidth = 4 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device interface { io.Writer io.ByteWriter // AttachTo connects a TTY to a console instance. AttachTo(console.Device) // State returns the TTY's state. State() State // SetState updates the TTY's state. SetState(State) // CursorPosition returns the current cursor x,y coordinates. Both // coordinates are 1-based (top-left corner has coordinates 1,1). CursorPosition() (uint32, uint32) // SetCursorPosition sets the current cursor position to (x,y). Both // coordinates are 1-based (top-left corner has coordinates 1,1). // Implementations are expected to clip the cursor position to their // viewport. SetCursorPosition(x, y uint32) }
Device is implemented by objects that can be used as a terminal device.
type VT ¶
type VT struct {
// contains filtered or unexported fields
}
VT implements a terminal supporting scrollback. The terminal interprets the following special characters:
- \r (carriage-return)
- \n (line-feed)
- \b (backspace)
- \t (tab; expanded to tabWidth spaces)
func NewVT ¶
NewVT creates a new virtual terminal device. The tabWidth parameter controls tab expansion whereas the scrollback parameter defines the line count that gets buffered by the terminal to provide scrolling beyond the console height.
func (*VT) CursorPosition ¶
CursorPosition returns the current cursor position.
func (*VT) DriverInit ¶
DriverInit initializes this driver.
func (*VT) DriverName ¶
DriverName returns the name of this driver.
func (*VT) DriverVersion ¶
DriverVersion returns the version of this driver.
func (*VT) SetCursorPosition ¶
SetCursorPosition sets the current cursor position to (x,y).