func (*screenParser) Setup() error {
	return nil
}
these are pointers so that we don't copy the mutex,
which isn't a big deal here cause we're not using it,
but makes the race detector sad anyway
package term
import (
	"sync"
	"syscall"
	"fmt"
	"unicode/utf8"
	"github.com/gdamore/tcell"
	"github.com/c-bata/go-prompt"
)
type screenIsh interface {
	ShowCursor(int, int)
	HideCursor()
	RequestRepaint()
}
type cellWriter struct {
	textMu sync.Mutex
	screen screenIsh
	startRow, startCol int
	text textWrapper
	currentStyle tcell.Style
}
func (w *cellWriter) SetBox(box PositionBox) {
	w.textMu.Lock()
	defer w.textMu.Unlock()
	w.startCol = box.StartCol
	w.startRow = box.StartRow
	w.text.rows = box.Rows
	w.text.cols = box.Cols
	w.text.buf.Resize(box.Cols, box.Rows)
}
func (w *cellWriter) WriteRaw(data []byte) {
	if len(data) == 1 && data[0] == '\n' {
		w.Newline()
		return
	}
	panic(fmt.Sprintf("non-newline raw write not implemented: %v", data))
}
func (w *cellWriter) Write(data []byte) {
	panic("not used")
}
func (w *cellWriter) WriteRawStr(data string) {
	panic("not used")
}
func (w *cellWriter) WriteStr(data string) {
	w.WriteString(data, w.currentStyle)
}
func (w *cellWriter) Flush() error {
	w.screen.RequestRepaint()
	return nil
}
func (w *cellWriter) EraseScreen() {
	w.Erase()
}
func (w *cellWriter) ShowCursor() {
	cursorCol, cursorRow := w.CursorPosition()
	w.screen.ShowCursor(w.startCol+cursorCol, w.startRow+cursorRow)
}
func (w *cellWriter) HideCursor() {
	w.screen.HideCursor()
}
func (w *cellWriter) AskForCPR() {
	panic("not used")
}
func (w *cellWriter) SaveCursor() {
	panic("not used")
}
func (w *cellWriter) UnSaveCursor() {
	panic("not used")
}
func (w *cellWriter) SetTitle(title string) {
}
func (w *cellWriter) ClearTitle() {
}
func (w *cellWriter) SetColor(fg, bg prompt.Color, bold bool) {
	w.currentStyle = tcell.StyleDefault.Bold(bold)
	if fg != prompt.DefaultColor {
		w.currentStyle = w.currentStyle.Foreground(tcell.Color(fg-1))
	}
	if bg != prompt.DefaultColor {
		w.currentStyle = w.currentStyle.Background(tcell.Color(bg-1))
	}
}
type screenParser struct {
	size *prompt.WinSize
	evts chan *tcell.EventKey
	leftOvers []byte
	mu sync.Mutex
}