erikgeiser / promptkit

Go prompt library
MIT License
249 stars 21 forks source link

Is README outdated on Windows support? #29

Closed danenania closed 11 months ago

danenania commented 11 months ago

Thanks for this library. The README says:

Windows is currently not explicitly supported because input events are dropped when running multiple prompts sequentially due to a bug in bubbletea. See https://github.com/charmbracelet/bubbletea/pull/140 and https://github.com/charmbracelet/bubbletea/issues/121 for more information.

But it seems these issues have been resolved in bubbletea. Does that mean that Windows is now supported and the README should be updated? Or perhaps the bubbletea dependency needs a version bump?

erikgeiser commented 11 months ago

Unfortunately, my PR that would have made it work was not merged because it was a big code change and after a while, the branches diverged too much.

The issue is that each promptkit prompt is a single bubbletea "program". This means that multiple prompts result in multiple programs. However, bubbletea assumes that you only ever run a single bubbletea program in the lifetime of your entire process. Initially, they used a hack to read the input that resulted in a buggy input for subsequent bubbletea programs. I was able to fix that for Unix-like OSs but the fix for Windows needed a much larger redesign which was ultimately not merged.

danenania commented 11 months ago

I see, thanks for the explanation @erikgeiser!