Documentation
¶
Overview ¶
Package easyterm is a wrapper for "github.com/pkg/term/termios". it provides some features not present in the third-party package, such as terminal geometry, and wraps termios methods in functions with friendlier names
Package easyterm is a wrapper for "github.com/pkg/term/termios". it provides some features not present in the third-party package, such as terminal geometry, and wraps termios methods in functions with friendlier names
Index ¶
- Constants
- func SuspendProcess()
- type EasyTerm
- func (et *EasyTerm) CBreakMode()
- func (et *EasyTerm) CanonicalMode()
- func (et *EasyTerm) CleanUp()
- func (et *EasyTerm) Flush() error
- func (et *EasyTerm) Initialise(inputFile, outputFile *os.File) error
- func (et *EasyTerm) RawMode()
- func (et *EasyTerm) TermPrint(s string)
- func (et *EasyTerm) UpdateGeometry() error
- type TermGeometry
Constants ¶
const ( KeyInterrupt = 3 // end-of-text character KeySuspend = 26 // substitute character KeyTab = 9 KeyCarriageReturn = 13 KeyEsc = 27 KeyBackspace = 127 KeyCtrlH = 8 )
list of ASCII codes for non-alphanumeric characters
const ( EscDelete = 51 EscCursor = 91 EscHome = 72 EscEnd = 70 )
list of ASCII code for characters that can follow KeyEsc
const ( CursorUp = 'A' CursorDown = 'B' CursorForward = 'C' CursorBackward = 'D' )
list of ASCII code for characters that can follow EscCursor
Variables ¶
This section is empty.
Functions ¶
func SuspendProcess ¶
func SuspendProcess()
SuspendProcess manually suspends the current process. This is useful if terminal is in raw mode and the terminal is given the suspend signal.
Types ¶
type EasyTerm ¶
type EasyTerm struct { Geometry TermGeometry // contains filtered or unexported fields }
EasyTerm is the main container for posix terminals. usually embedded in other struct types
func (*EasyTerm) CBreakMode ¶
func (et *EasyTerm) CBreakMode()
CBreakMode puts terminal into cbreak mode
func (*EasyTerm) CanonicalMode ¶
func (et *EasyTerm) CanonicalMode()
CanonicalMode puts terminal into normal, everyday canonical mode
func (*EasyTerm) CleanUp ¶
func (et *EasyTerm) CleanUp()
CleanUp closes resources created in the Initialise() function
func (*EasyTerm) Initialise ¶
Initialise the fields in the Terminal struct
func (*EasyTerm) UpdateGeometry ¶
UpdateGeometry gets the current dimensions (in characters and pixels) of the output terminal
type TermGeometry ¶
type TermGeometry struct {
// contains filtered or unexported fields
}
TermGeometry contains the dimensions of a terminal (usually the output terminal)