mirror of https://github.com/chzyer/readline.git
fix issule #169 for single line case
This commit is contained in:
parent
2972be24d4
commit
30ec85bccf
|
@ -597,8 +597,8 @@ func (r *RuneBuffer) cleanOutput(w io.Writer, idxLine int) {
|
||||||
} else {
|
} else {
|
||||||
buf.Write([]byte("\033[J")) // just like ^k :)
|
buf.Write([]byte("\033[J")) // just like ^k :)
|
||||||
if idxLine == 0 {
|
if idxLine == 0 {
|
||||||
buf.WriteString("\033[2K")
|
buf.WriteString(strings.Repeat("\033[D", r.idx + r.promptLen()))
|
||||||
buf.WriteString("\r")
|
buf.Write([]byte("\033[J"))
|
||||||
} else {
|
} else {
|
||||||
for i := 0; i < idxLine; i++ {
|
for i := 0; i < idxLine; i++ {
|
||||||
io.WriteString(buf, "\033[2K\r\033[A")
|
io.WriteString(buf, "\033[2K\r\033[A")
|
||||||
|
|
Loading…
Reference in New Issue