Skip to content

Commit

Permalink
fix issule chzyer#169 for single line case
Browse files Browse the repository at this point in the history
  • Loading branch information
kinogmt committed Mar 13, 2019
1 parent 2972be2 commit b311650
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runebuf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit b311650

Please sign in to comment.