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 {
|
||||
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")
|
||||
|
|
Loading…
Reference in New Issue