readline
readline copied to clipboard
Readline() cleans up the last line which does not have \n at the end.
With following example code, Readline() cleans up the last line "This line will be cleaned up after 10 seconds...".
I think it's better to print the next prompt just after the line without deleting it.
https://github.com/kinogmt/rltest
package main
import (
"fmt"
"github.com/chzyer/readline"
"time"
)
func main() {
rl, _ := readline.New("> ")
defer rl.Close()
fmt.Printf("This line will be cleaned up after 10 seconds...")
time.Sleep(10 * time.Second)
_, _ = rl.Readline()
}
This is probably related to #150
This bug is soooo old. I was running into it about 3 years ago and in the end I wrote my own readline package. There's a few forks of this project which are maintained (or at least were, might not be any more)
This bug is soooo old. I was running into it about 3 years ago and in the end I wrote my own readline package. There's a few forks of this project which are maintained (or at least were, might not be any more)
Hello, Imorg. I try to use this but meet this bug too. So where is the bug happen in the source?