c-bata / go-prompt

Building powerful interactive prompts in Go, inspired by python-prompt-toolkit.
https://godoc.org/github.com/c-bata/go-prompt
MIT License
5.27k stars 349 forks source link

Catch a signal that window size is changed on Windows #41

Open c-bata opened 6 years ago

c-bata commented 6 years ago

I wrote that "windows support is almost perfect" in change log of v0.2.1 but I noticed a critical bug a while ago :(

Current implementation of go-prompt cannot catch signal for updating window size on Windows. So if you change a size of terminal emulator, the layout will be broken.

On Windows, ReadConsoleInput and WINDOW_BUFFER_SIZE_EVENT can be used for receiving window size change events.

c-bata commented 6 years ago

This problem will be fixed at #83.

zhusulai commented 6 years ago

Looking forward to this fix.