bundles / IPython 9.18.0.dev / IPython / terminal / interactiveshell / TerminalInteractiveShell / refresh_style
function
IPython.terminal.interactiveshell:TerminalInteractiveShell.refresh_style
source: /dev/ipython/IPython/terminal/interactiveshell.py:364
Signature
def refresh_style(self) → NoneSummary
Invalidate the prompt style, so that it is rebuilt when next needed.
Extended Summary
Building it means turning a whole pygments style into prompt_toolkit style rules, which is not cheap, and refresh_style is called several times while a shell is set up -- once from init_syntax_highlighting on colors being set, again from init_magics, again when the prompt_toolkit application is created. Only the last state matters, and for a non-interactive run (ipython -c ..., --simple-prompt, a kernel) none of them do: the style is only ever read through the DynamicStyle the prompt session renders with.
Aliases
IPython.terminal.embed.TerminalInteractiveShell.refresh_style