We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c00e6c2 commit e9c3333Copy full SHA for e9c3333
src/sage/repl/inputhook.py
@@ -47,15 +47,25 @@ def install():
47
"""
48
Install the Sage input hook
49
50
- EXAMPLES::
+ EXAMPLES:
51
+
52
+ Make sure ipython is running so we really test this function::
53
54
+ sage: from sage.repl.interpreter import get_test_shell
55
+ sage: get_test_shell()
56
+ <sage.repl.interpreter.SageTestShell object at ...>
57
58
+ Run the function twice, to check it is idempotent (see :trac:`35235`)::
59
60
sage: from sage.repl.inputhook import install
61
sage: install()
62
+ sage: install()
63
64
ip = get_ipython()
65
if not ip:
66
return # Not running in ipython, e.g. doctests
- ip.enable_gui('sage')
67
+ if ip._inputhook != sage_inputhook:
68
+ ip.enable_gui('sage')
69
70
71
def uninstall():
0 commit comments