Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase the ipython qtconsole scrollback buffer limit

When I load ipython with any one of:

ipython qtconsole
ipython qtconsole --pylab
ipython qtconsole --pylab inline

The output buffer only holds the last 500 lines. To see this run:

for x in range(0, 501):
   ...:     print x

Is there a configuration option for this? I've tried adjusting --cache-size but this does not seem to make a difference.

like image 851
Philip Avatar asked Feb 06 '13 02:02

Philip


Video Answer


1 Answers

Quickly:

ipython qtconsole --IPythonWidget.buffer_size=1000

Or you can set it permanently by adding:

c.IPythonWidget.buffer_size=1000

in your ipython config file.

For discovering this sort of thing, a helpful trick is:

ipython qtconsole --help-all | grep PATTERN

For instance, you already had 'buffer', so:

$> ipython qtconsole --help-all | grep -C 3 buffer
...
--IPythonWidget.buffer_size=<Integer>
    Default: 500
    The maximum number of lines of text before truncation. Specifying a non-
    positive number disables text truncation (not recommended).

If IPython used a different name than you expect and that first search turned up nothing, then you could use 500, since you knew what the value was that you wanted to change, which would also find the relevant config.

like image 118
minrk Avatar answered Oct 20 '22 00:10

minrk