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.11k stars 717 forks source link

in_thread keyword is passed through 'prompt' shortcut #1760

Closed erwinkinn closed 1 year ago

erwinkinn commented 1 year ago

Hello! First, thank you you all for such a powerful toolkit making absolutely easy to use interactive prompts. I develop an async code debugging tool based on clic_repl. I call click_repl session rigth from inside a coroutine. click_repl in turn uses the toolkit to manage a prompt. It calls your prompt_toolkit.shortcut.prompt.prompt passing all the arguments as a dictionary. My issue is that I call it from inside a coroutine and I must pass in_thread = True because my loop is already running. And this keyword is not passed further for some reason. This PR fixes it.

erwinkinn commented 1 year ago

Hi, there! This repo has a mypy issue. I didn't do any castings but my PR (as well as the previous one) has some failed checks, hence I've added a fix.

jonathanslenders commented 1 year ago

Thank you!