Skip to content

[Bug] After exiting the program, ctrl+c is invalid #233

@lpxxn

Description

@lpxxn

Bug reports

Mac os bigsur
go version go1.16.2 darwin/amd64
go-prompt v0.2.6
iTerm2
code :
main.go

package main

import (
	"fmt"
	"github.com/c-bata/go-prompt"
)
func completer(d prompt.Document) []prompt.Suggest {
	s := []prompt.Suggest{
		{Text: "users", Description: "Store the username and age"},
		{Text: "articles", Description: "Store the article text posted by user"},
	}
	return prompt.FilterHasPrefix(s, d.GetWordBeforeCursor(), true)
}
func main() {
	fmt.Println("Please select table.")
	t := prompt.Input("👻 > ", completer)
	fmt.Println("You selected " + t)
}

in iterm2 run go run main.go after exit the program,and than run go run main2.go ctrl+c not work
can not exit program
main2.go

package main
import "time"
func main() {
	time.Sleep(100*time.Second)
}

open a new iterm2 tab run go run main2.go than ctrl+c can exit the program

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions