prompt-toolkit / python-prompt-toolkit

Library for building powerful interactive command line applications in Python
https://python-prompt-toolkit.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
9.28k stars 715 forks source link

Screen Flickers when Rendering Dialogs #1664

Open umar-afzaal opened 2 years ago

umar-afzaal commented 2 years ago

So we have a menu, and when we start a test, the screen flickers. And sometimes it doesn't flicker. We have tried disabling the cursor before rendering the dialog, but it doesn't work.

The issue also persists for dialogs with no cursors, like a dialog with an Ok button.

Watch the video here

image

isecvirus commented 2 years ago

Hey @umar-afzaal try adding time.sleep(0.001) and increase the 0.001 by ms till you see it gone. this happning because of the fast process rendering.. so you need to add a microseconds timeout between every render process that the program do.