diff --git a/runebuf.go b/runebuf.go index 81d2da5..1e054c0 100644 --- a/runebuf.go +++ b/runebuf.go @@ -597,8 +597,8 @@ func (r *RuneBuffer) cleanOutput(w io.Writer, idxLine int) { } else { buf.Write([]byte("\033[J")) // just like ^k :) if idxLine == 0 { - buf.WriteString("\033[2K") - buf.WriteString("\r") + buf.WriteString(strings.Repeat("\033[D", r.idx + r.promptLen())) + buf.Write([]byte("\033[J")) } else { for i := 0; i < idxLine; i++ { io.WriteString(buf, "\033[2K\r\033[A")