In IPython version 5.x, this is mentioned in the documentation: Specific config details — IPython 5.11.0.dev documentation
To get the function to bind to, see key_binding/bindings/basic.py
: The default is
handle("pageup", filter=~has_selection)(get_by_name("previous-history"))
handle("pagedown", filter=~has_selection)(get_by_name("next-history"))
So, put this code in a startup file:
from IPython import get_ipython
from prompt_toolkit.filters import HasSelection
from prompt_toolkit.keys import Keys
from prompt_toolkit.key_binding.bindings.named_commands import get_by_name
registry = get_ipython().pt_cli.application.key_bindings_registry
registry.add_binding(Keys.PageUp, filter=~HasSelection())(get_by_name("next-history"))
registry.add_binding(Keys.PageDown, filter=~HasSelection())(get_by_name("previous-history"))
On newer IPython versions (such as 7.19.0) replace the registry = ...
line with
registry = get_ipython().pt_app.key_bindings
Reference: Specific config details — IPython 7.19.0 documentation