func (w *Writer) Start() {
	if w.ticker == nil {
		w.ticker = time.NewTicker(w.RefreshInterval)
		w.tdone = make(chan bool)
	}
	go w.Listen()
}
Start starts the listener in a non-blocking manner
package uilive
import (
	"bytes"
	"errors"
	"io"
	"os"
	"sync"
	"time"
)
const ESC = 27
var RefreshInterval = time.Millisecond
var overFlowHandled bool
var termWidth int
var Out = io.Writer(os.Stdout)
var ErrClosedPipe = errors.New("uilive: read/write on closed pipe")
type FdWriter interface {
	io.Writer
	Fd() uintptr
}
type Writer struct {
	Out io.Writer
	RefreshInterval time.Duration
	ticker *time.Ticker
	tdone  chan bool
	buf       bytes.Buffer
	mtx       *sync.Mutex
	lineCount int
}
type bypass struct {
	writer *Writer
}
type newline struct {
	writer *Writer
}
func New() *Writer {
	termWidth, _ = getTermSize()
	if termWidth != 0 {
		overFlowHandled = true
	}
	return &Writer{
		Out:             Out,
		RefreshInterval: RefreshInterval,
		mtx: &sync.Mutex{},
	}
}
func (w *Writer) Flush() error {
	w.mtx.Lock()
	defer w.mtx.Unlock()
	if len(w.buf.Bytes()) == 0 {
		return nil
	}
	w.clearLines()
	lines := 0
	var currentLine bytes.Buffer
	for _, b := range w.buf.Bytes() {
		if b == '\n' {
			lines++
			currentLine.Reset()
		} else {
			currentLine.Write([]byte{b})
			if overFlowHandled && currentLine.Len() > termWidth {
				lines++
				currentLine.Reset()
			}
		}
	}
	w.lineCount = lines
	_, err := w.Out.Write(w.buf.Bytes())
	w.buf.Reset()
	return err
}