readline icon indicating copy to clipboard operation
readline copied to clipboard

Readline() cleans up the last line which does not have \n at the end.

Open kinogmt opened this issue 6 years ago • 3 comments

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()
}

kinogmt avatar Mar 11 '19 04:03 kinogmt

This is probably related to #150

agaffney avatar Sep 02 '19 04:09 agaffney

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)

lmorg avatar Feb 17 '20 19:02 lmorg

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?

Shylock-Hg avatar Apr 16 '20 08:04 Shylock-Hg