Open derekbrokeit opened 4 years ago
Thank you for reporting this issue! This needs to be fixed. What version of prompt_toolkit is this?
I think this is the example from Prompt-Toolkit 3.0
uvloop doesn't have _ready. You can just comment it out in utils.py. The UI will be a little less responsive, but thats the only change.
#if not loop2._ready: # type: ignore
# func()
# return
Any news on this?
This should fix it: https://github.com/prompt-toolkit/python-prompt-toolkit/pull/1088/files
edit: sorry for the delay/inconvenience!
I have a custom app that I tried to run using uvloop but frequently calling app.invalidate() causes the output to glitch and the terminal turns into a mess of random numbers. Using the default loop, everything is fine.
OS: osx 10.15.3 uvloop: 0.14.0 prompt-toolkit: 3.0.5
I'll try a build a minimal example to recreate the issue.
I found that running the example script with
uvloop
instead of the selector event loop fails to properly communicate with the client. Primary failure is that the buffer text does not get sent to the client until after a single line is processed. The other UI elements (e.g. progress bar, etc.) also behave unexpectedly. A number of errors are also logged. Lastly, I tested this with aptpython
repl. When a keyboard interrupt is used, this signal gets passed to the event loop, which causes the server to stop, which makes it unusable.The following is a set of some of the errors displayed for the progress bar and UI elements:
The following is the test script that I used. I added a
ptpython
repl for good measure.