Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lines are eaten while selecting and outputing at the same time #190

Open
BLACK-RAIN-BOW opened this issue Oct 4, 2021 · 1 comment
Open

Comments

@BLACK-RAIN-BOW
Copy link

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>?

@m0sh1x2
Copy link

m0sh1x2 commented Dec 24, 2021

I am experiencing exactly the same issue.

Can you let me know if you found a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants