##// END OF EJS Templates
Backport PR #10231: Fix set_next_input with prompt_toolkit 1.0.10...
Backport PR #10231: Fix set_next_input with prompt_toolkit 1.0.10 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.

File last commit:

r16113:87737521
r23383:e2b6ae93
Show More
embed_function.py
16 lines | 258 B | text/x-python | PythonLexer
"""Embed IPython using the simple embed function rather than the class API."""
from IPython import embed
a = 10
b = 20
embed(header='First time', banner1='')
c = 30
d = 40
try:
raise Exception('adsfasdf')
except:
embed(header='The second time')