func NewTerminal() (*Terminal, error) {
	in := os.Stdin
	term, err := newTerminal(in)
	if err != nil {
		return nil, err
	}
	return &Terminal{
		In:      in,
		Out:     os.Stdout,
		History: make([]string, 0, 10),
		histIdx: -1,
		t:       term,
	}, nil
}
NewTerminal creates a terminal and sets it to raw input mode.
package prompt
import (
	"bufio"
	"errors"
	"io"
	"os"
	"strings"
)
var (
	ErrCTRLC = errors.New("Interrupted (CTRL+C)")
	ErrEOF = errors.New("EOF (CTRL+D)")
)
const (
	evChar = iota
	evSkip
	evReturn
	evEOF
	evCtrlC
	evBack
	evClear
	evHome
	evEnd
	evUp
	evDown
	evRight
	evLeft
	evDel
)
func IsNotTerminal(err error) bool {
	return isNotTerminal(err)
}
func TerminalSize(out *os.File) (int, int, error) {
	return terminalSize(out)
}
type Terminal struct {
	In           *os.File
	Out          *os.File
	History      []string
	histIdx      int
	simpleReader *bufio.Reader
	t            *terminal
}