go-prompt
go-prompt copied to clipboard
[Bug] Terminal Colors not reset after application exists
Bug reports
Please file a bug report here.
Expected Behavior
When go-prompt application is terminated (ctrl^D), terminal color's need to be reset.
Current Behavior and Steps to Reproduce
After exiting go-prompt application (ex: simple-echo), the terminal & shell (mac terminal, iterm2, ubuntu bash) are in a state where you cannot see any characters being typed. Restarting the shell resolved the issue, until the next time you run the go-prompt application:
`vagrant@dev:~/host_user_homedir/go-workspace/src/go-prompt/_example/simple-echo$ go run main.go
users Your input: users vagrant@dev:~/host_user_homedir/go-workspace/src/go-prompt/_example/simple-echo$ ddddddd: command not found `
https://user-images.githubusercontent.com/577870/196228129-16339375-7b4f-4499-8cd7-e152257ad35d.mov
Context
Mac 11.7 with iTerm2 and terminal Ubuntu 20.04 with default bash shell
This looks like a dup of https://github.com/c-bata/go-prompt/issues/228
或者在程序执行os.Exit()前执行
cmd := exec.Command("reset")
err := cmd.Run()