manifoldco / promptui

Interactive prompt for command-line applications
https://www.manifold.co
BSD 3-Clause "New" or "Revised" License
6.03k stars 333 forks source link

Promptui clears the entire screen/buffer in windows. #108

Open emmggi opened 5 years ago

emmggi commented 5 years ago

When it runs into the promptui function and sometimes if there's even not a selection it'll just clear the entire screen. This happens only on windows. I'm running 7 Home Premium and the default cmd.

Example

1st case is normal 2nd case is with it showing the prompt and clearing the entire buffer beforehand 3rd case is normal again 4th case is when it doesn't show a prompt but still clears the screen/buffer

    var result string

    if len(searchresults) > 1 {
        prompt := promptui.Select{
            Label: "Pick one of the following",
            Items: searchresults, // []string containing entries
        }

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

        result = finalresult
        if err != nil {
            fmt.Printf("Error %v\n", err)
            return
        }
    } else {
        return
    }