This is a development version (latest) and may be unstable.Go to latest (9.17.0)
{ } Raw JSON

bundles / IPython latest / 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) → None

Summary

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