The Sage Read-Eval-Print-Loop (REPL) is based on IPython. In this document, you’ll find how the IPython integration works. You should also be familiar with the documentation for IPython.
For more details about using the Sage command line, see the Sage tutorial.
In addition to making input nicer, we also modify how results are printed. This again builds on how IPython formats output. Technically, this works using a modified displayhook in Python.