Documentation
¶
Index ¶
- Variables
- func EscapeHistoryCommand(input []byte) []byte
- func EscapeInput(input []byte) []byte
- func EscapeTabCompletion(src []byte) []byte
- func HasDownArrowSuffix(input []byte) bool
- func HasUpArrowSuffix(input []byte) bool
- func IsBell(bs []byte) bool
- func IsCR(input []byte) bool
- func IsTab(input []byte) bool
- type Input
- func (in *Input) AddCharacter(r rune)
- func (in *Input) Backspace()
- func (in *Input) DeleteCharacterUnderCursor()
- func (in *Input) DeleteCharactersAfterCursor()
- func (in *Input) DeleteCharactersBeforeCursor()
- func (in *Input) DeleteOneWordBeforeCursor()
- func (in *Input) GoBackOneCharacter()
- func (in *Input) GoBackOneWord()
- func (in *Input) GoEnd()
- func (in *Input) GoForwardOneCharacter()
- func (in *Input) GoForwardOneWord()
- func (in *Input) GoHead()
Constants ¶
This section is empty.
Variables ¶
var ( // UpArrow denotes up arrow UpArrow = []byte{asciiESC, asciiLeftSquareBracket, asciiA} // DownArrow denotes down arrow DownArrow = []byte{asciiESC, asciiLeftSquareBracket, asciiB} )
Functions ¶
func EscapeHistoryCommand ¶
EscapeHistoryCommand escape history command
func EscapeInput ¶
EscapeInput escape special characters such as SOH, ENQ and DEL in user input
func EscapeTabCompletion ¶
EscapeTabCompletion escape tab completion
func HasDownArrowSuffix ¶
HasDownArrowSuffix test whether input has down arrow suffix
func HasUpArrowSuffix ¶
HasUpArrowSuffix test whether input has up arrow suffix
Types ¶
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
Input denotes user input from terminal
func (*Input) AddCharacter ¶
AddCharacter add one character to input
func (*Input) DeleteCharacterUnderCursor ¶
func (in *Input) DeleteCharacterUnderCursor()
DeleteCharacterUnderCursor delete the character under the cursor
func (*Input) DeleteCharactersAfterCursor ¶
func (in *Input) DeleteCharactersAfterCursor()
DeleteCharactersAfterCursor delete the character after the cursor
func (*Input) DeleteCharactersBeforeCursor ¶
func (in *Input) DeleteCharactersBeforeCursor()
DeleteCharactersBeforeCursor delete characters before the cursor
func (*Input) DeleteOneWordBeforeCursor ¶
func (in *Input) DeleteOneWordBeforeCursor()
DeleteOneWordBeforeCursor delete word before the cursor
func (*Input) GoBackOneCharacter ¶
func (in *Input) GoBackOneCharacter()
GoBackOneCharacter go back one character
func (*Input) GoForwardOneCharacter ¶
func (in *Input) GoForwardOneCharacter()
GoForwardOneCharacter go forward one character
func (*Input) GoForwardOneWord ¶
func (in *Input) GoForwardOneWord()
GoForwardOneWord go forward one word