Documentation
¶
Index ¶
- Constants
- Variables
- func DetectColorLevel(_ int) int
- func GetWriterFd(writer io.Writer) (int, bool)
- func ReadCtx[T any](ctx context.Context, t *Terminal, readFn func(*Terminal) (T, error)) (T, error)
- func WaitForInterrupt()
- type Result
- type Terminal
- func (t *Terminal) Close()
- func (t *Terminal) HideCursor()
- func (t *Terminal) ReadArrow() (int, error)
- func (t *Terminal) ReadKey() (rune, error)
- func (t *Terminal) ReadLine() ([]byte, error)
- func (t *Terminal) ReadMasked(out io.Writer, mask rune) ([]byte, error)
- func (t *Terminal) ReadVisible(out io.Writer, buf []byte, max int) ([]byte, error)
- func (t *Terminal) ShowCursor()
Constants ¶
View Source
const ( InvalidInput = iota ArrowUp ArrowDown ArrowLeft ArrowRight Enter Cancel ModeNone = iota - 1 ModeSome Mode8Bit ModeFull )
Variables ¶
View Source
var ErrInterrupted = errors.New("interrupted")
Functions ¶
func DetectColorLevel ¶
func WaitForInterrupt ¶
func WaitForInterrupt()
Types ¶
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
func (*Terminal) HideCursor ¶
func (t *Terminal) HideCursor()
func (*Terminal) ReadMasked ¶
func (*Terminal) ReadVisible ¶
func (*Terminal) ShowCursor ¶
func (t *Terminal) ShowCursor()
Click to show internal directories.
Click to hide internal directories.