I'm really only using it for command history up/down functionality on windows - I couldn't get pyreadline3 to work correctly. Everything works fine, but using the up and down keys creates up to 40 threads that never go away.
from prompt_toolkit import prompt
from prompt_toolkit.history import FileHistory
while True:
print("\n")
print("=============")
print("Enter command")
command_text = prompt('>', history=FileHistory('command_history.txt'),)
cmd = command_text.lower().strip()
if cmd == "": # skip empty input
continue
if cmd == "exit": # bail
break
process_command(cmd)
That's basically it. Is this normal behavior? I guess the threadpool just creates new threads up to its maximum, but it seems a little excessive for this task, and makes my VScode call stack a mess.