t`. There are situations where prompt_toolkit applications are created in one thread, but will later run in a different thread (Ptpython is one example. The REPL runs in a separate thread, in order to prevent interfering with a potential different event loop in the main thread. The REPL UI however is still created in the main thread.) We could decide to not support creating prompt_toolkit objects in one thread and running the application in a different thread, but history loading is the only place where it matters, and this solves it. NrC