ErichDonGubler / termion

A bindless library for controlling terminals/TTY.
MIT License
4 stars 1 forks source link

`WindowsConIn`: better implementation for `read`? #12

Open ErichDonGubler opened 6 years ago

ErichDonGubler commented 6 years ago

Right now we're serving the case illustrated in the async example, where the bytes method and iterator is used to get everything from the current TTY. I have some doubt about whether all iterator methods will actually work -- we should test with other Read methods too, since it's the interface exposed in get_tty.

ErichDonGubler commented 6 years ago

Oooh, Python 3.6.5 just had to handle this particular problem by switching their Windows console implementation to use UTF-8: https://github.com/python/cpython/blob/master/Parser/myreadline.c#L102

We can probably just use this buffering algorithm wholesale -- perhaps make a crate for it, to save other people time. :)