Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

IPython (at least the version we use) isn't really designed for this sort of customization, but there is a hack to make it behave this way. If you run the following commands (or put them in your ~/.sage/init.sage file), it should behave exactly how you want.

import IPython.OInspect
IPython.OInspect.page = specialize(screen_lines=0.5r)(IPython.OInspect.page)

specialize is a decorator which causes a default value of screen_lines=0.5 to be passed on to the real page function. Basically what this does is tell IPython that the number of lines in your screen is greater than 0 (so it doesn't try to autodetect it, the default case) and less than any number of lines that would be displayed.