Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

When .Ask fails, the terminal state isn’t restored #282

Closed
skitt opened this issue Mar 5, 2020 · 0 comments · Fixed by #337
Closed

When .Ask fails, the terminal state isn’t restored #282

skitt opened this issue Mar 5, 2020 · 0 comments · Fixed by #337

Comments

@skitt
Copy link

skitt commented Mar 5, 2020

When survey is used with no input, it fails (EOF) and leaves the terminal as-is, with the cursor in the bottom-right-hand corner and hidden.

Reproducer:

package main

import (
	"github.com/AlecAivazis/survey/v2"
)

func main() {
	cont := false
	survey.AskOne(&survey.Confirm{
		Message: "Do you want to continue?",
	}, &cont)
}

Run as ./surveydemo < /dev/null.

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

Successfully merging a pull request may close this issue.

2 participants
@skitt and others