Documentation ¶
Index ¶
- func WordWrap(txt string, width int) []string
- type OnCommandFunc
- type OnCtrlFunc
- type OnFunc
- type OnRuneFunc
- type Screen
- func (s *Screen) AddHistory(cmd string)
- func (s *Screen) AddText(txt string)
- func (s *Screen) ClearCommand()
- func (s *Screen) ClearText()
- func (s *Screen) ClearTextBuffer()
- func (s *Screen) Close()
- func (s *Screen) P(x, y int, txt string)
- func (s *Screen) PC()
- func (s *Screen) PL()
- func (s *Screen) Quit()
- func (s *Screen) Refresh()
- func (s *Screen) Run()
- func (s *Screen) SetCommandFunc(fn OnCommandFunc)
- func (s *Screen) SetCtrlFunc(fn OnCtrlFunc)
- func (s *Screen) SetEscFunc(fn OnFunc)
- func (s *Screen) SetRuneFunc(fn OnRuneFunc)
- func (s *Screen) SetStatus(txt string)
- func (s *Screen) SetTabFunc(fn OnFunc)
- func (s *Screen) SetTitle(t string)
- func (s *Screen) UpdateStatus()
- func (s *Screen) UpdateTitle()
- func (s *Screen) Whiteout(x, y, n int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type OnCommandFunc ¶
type OnCommandFunc = func(string)
OnCommandFunc is the callback to run when a command has been entered and return has been pressed.
type OnCtrlFunc ¶
OnCtrlFunc is the callback for ctrl+<key> combinations without other modifiers.
type OnRuneFunc ¶
ObRuneFunc is the callback for keypresses corresponding to a printable character, including space. Use this to filter or modify the input. Return the rune to display as-is, 0 to skip it, or modify the command buffer directly.
type Screen ¶
type Screen struct { sync.WaitGroup tcell.Screen // callbacks OnRune OnRuneFunc OnCommand OnCommandFunc OnTab OnFunc OnEsc OnFunc OnCtrl OnCtrlFunc // contains filtered or unexported fields }
Screen controls a terminal's input and output.
func (*Screen) AddHistory ¶
AddHistory adds a string to the command history.
func (*Screen) AddText ¶
AddText adds text to the output buffer, splitting it if needed. TODO: History buffer and PgUp/PgDown.
func (*Screen) ClearCommand ¶
func (s *Screen) ClearCommand()
ClearCommand clears the command buffer and updates the display.
func (*Screen) ClearTextBuffer ¶
func (s *Screen) ClearTextBuffer()
ClearTextBuffer clears the output buffer.
func (*Screen) Quit ¶
func (s *Screen) Quit()
Quit signals that the screen should close and the input loop should stop.
func (*Screen) SetCommandFunc ¶
func (s *Screen) SetCommandFunc(fn OnCommandFunc)
SetCommandFunc sets a command handler.
func (*Screen) SetCtrlFunc ¶
func (s *Screen) SetCtrlFunc(fn OnCtrlFunc)
SetEscFunc sets a callback for control keys.
func (*Screen) SetEscFunc ¶
SetEscFunc sets a callback for escape.
func (*Screen) SetRuneFunc ¶
func (s *Screen) SetRuneFunc(fn OnRuneFunc)
SetRuneFunc sets an input filter callback for command input.
func (*Screen) UpdateStatus ¶
func (s *Screen) UpdateStatus()
UpdateStatus updates the status text and symbol in front of the command line.
func (*Screen) UpdateTitle ¶
func (s *Screen) UpdateTitle()
UpdateTitle refreshes the title display.