diff --git a/IPython/zmq/ipkernel.py b/IPython/zmq/ipkernel.py index ef7a934..70dfffc 100755 --- a/IPython/zmq/ipkernel.py +++ b/IPython/zmq/ipkernel.py @@ -486,9 +486,10 @@ class Kernel(Configurable): raw=raw, output=output) elif hist_access_type == 'search': + n = parent['content']['n'] pattern = parent['content']['pattern'] hist = self.shell.history_manager.search(pattern, raw=raw, - output=output) + output=output, n=n) else: hist = [] diff --git a/docs/source/development/messaging.txt b/docs/source/development/messaging.txt index c98041d..55bfbf9 100644 --- a/docs/source/development/messaging.txt +++ b/docs/source/development/messaging.txt @@ -627,7 +627,7 @@ Message type: ``history_request``:: 'start' : int, 'stop' : int, - # If hist_access_type is 'tail', get the last n cells. + # If hist_access_type is 'tail' or 'search', get the last n cells. 'n' : int, # If hist_access_type is 'search', get cells matching the specified glob