manifoldco / promptui

Interactive prompt for command-line applications

Home Page:https://www.manifold.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lines are eaten while selecting and outputing at the same time

BLACK-RAIN-BOW opened this issue · comments

Here's the code snippet:

prompt := promptui.Select{
	Label: "Select Day",
	Items: []string{"Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
		"Saturday", "Sunday"},
}
go func() {
	i := 0
	for {
		i++
		for j := 1; j <= i*2; j++ {
			fmt.Println(strings.Repeat(strconv.Itoa(i), 40))
		}
		time.Sleep(2 * time.Second)
	}
}()

_, result, err := prompt.Run()

if err != nil {
	fmt.Printf("Prompt failed %v\n", err)
	return
}

fmt.Printf("You choose %q\n", result)

Can you provide some method to force rolling or other methods to fix>?

I am experiencing exactly the same issue.

Can you let me know if you found a workaround?