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

app.Suspend - read os.Stdin #515

Closed
JCzz opened this issue Oct 16, 2020 · 2 comments
Closed

app.Suspend - read os.Stdin #515

JCzz opened this issue Oct 16, 2020 · 2 comments

Comments

@JCzz
Copy link

JCzz commented Oct 16, 2020

Nice work

Can you see why I need to hit enter twice to return from suspend?

package main

import (
	"bufio"
	"fmt"
	"os"

	"github.com/rivo/tview"
)

func main() {

	app := tview.NewApplication()
	button := tview.NewButton("Hit Enter").SetSelectedFunc(func() {
		app.Suspend(func() {
			reader := bufio.NewReader(os.Stdin)
			fmt.Print("Enter text: ")
			reader.ReadString('\n')
		})
	})
	button.SetBorder(true).SetRect(0, 0, 22, 3)
	if err := app.SetRoot(button, false).Run(); err != nil {
		panic(err)
	}
}
@tslocum
Copy link
Contributor

tslocum commented Nov 12, 2020

This is a known bug. gdamore/tcell#194

@rivo
Copy link
Owner

rivo commented Dec 4, 2020

This will be resolved once the tcell bug is fixed. So I'm closing this issue as there's nothing I can do about this.

@rivo rivo closed this as completed Dec 4, 2020
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

3 participants