Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/sage/repl/all.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from sage.misc.lazy_import import lazy_import

from sage.repl.preparse import preparse, implicit_multiplication

lazy_import('sage.repl.interpreter', 'preparser')
lazy_import('sage.repl.interpreter', ['preparser', 'inline_plots'])

lazy_import('sage.repl.attach', [
'attach', 'detach', 'attached_files', 'load_attach_path',
Expand Down
4 changes: 3 additions & 1 deletion src/sage/repl/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ def inline_plots(on=None):

EXAMPLES::

sage: from sage.repl.interpreter import inline_plots
sage: type(inline_plots()) is bool
True
sage: inline_plots(False) # random
Expand All @@ -220,6 +219,9 @@ def inline_plots(on=None):
if not supports_kitty_graphics:
print('Inline plots are not supported for the current terminal and IPython version')
return
if not hasattr(IP, 'mime_renderers'):
# exit if we are not using the interactive shell
return
if on:
IP.mime_renderers['image/png'] = kitty_png_render
elif 'image/png' in IP.mime_renderers:
Expand Down
Loading