go-prompt icon indicating copy to clipboard operation
go-prompt copied to clipboard

[Bug] Terminal Colors not reset after application exists

Open mattdesmarais opened this issue 2 years ago • 2 comments

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

mattdesmarais avatar Oct 17 '22 16:10 mattdesmarais

This looks like a dup of https://github.com/c-bata/go-prompt/issues/228

mattdesmarais avatar Oct 17 '22 16:10 mattdesmarais

image 或者在程序执行os.Exit()前执行 cmd := exec.Command("reset") err := cmd.Run()

fasnow avatar Jul 04 '23 15:07 fasnow