-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix set_next_input with prompt_toolkit 1.0.10 #10231
Conversation
Hi @takluyver, |
Thanks, I've pushed a fix that only uses pre_run_callables if the attribute is there, and otherwise just sets the document directly. There are a few features in IPython that put some text at the next prompt; probably the most obvious is the |
We're getting a number of bug reports that I believe this would fix, if someone would like to review it. |
@meeseeksdev backport to 5.x |
Closes gh-10229 Please don't merge this just yet. jonathanslenders I discovered after updating that we can no longer set text in the buffer with a `pre_run` function, because `pre_run_callables` reset the buffer immediately after that. I've worked around this by adding another callable to `pre_run_callables` which sets the text that I want, but I don't know if this is the right way to do it, or whether it works with previous releases of prompt_toolkit.
Backport PR #10231 on branch 5.x
Closes gh-10229
Please don't merge this just yet.
@jonathanslenders I discovered after updating that we can no longer set text in the buffer with a
pre_run
function, becausepre_run_callables
reset the buffer immediately after that. I've worked around this by adding another callable topre_run_callables
which sets the text that I want, but I don't know if this is the right way to do it, or whether it works with previous releases of prompt_toolkit.