这是indexloc提供的服务,不要输入任何密码
Skip to content

The last line is being overwritten when width of the buffer exceeds screen width #3

@gosuri

Description

@gosuri

The last line seems to be overwritten when width of the buffer exceeds screen width:

screen shot 2015-12-08 at 11 11 19

Code:

package main

import (
    "fmt"
    "time"

    "github.com/gosuri/uilive"
)

func main() {
    writer := uilive.New()

    // start listening for updates and render
    writer.Start()

    str := ""
    for i := 0; i <= 100; i++ {
        str = str + "s"
    }
    str = str + "[end]"

    for i := 0; i <= 100; i++ {
        fmt.Fprintf(writer, "%d %s\n", i, str)
        time.Sleep(time.Second)
    }

    writer.Stop() // flush and stop rendering
}

(Ref #2)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions