through the history. - ``Down``: step forwards through the history. - ``Shift-Up``: search backwards through the history (like ``Control-r`` in bash). - ``Shift-Down``: search forwards through the history. - ``Control-c``: copy highlighted text to clipboard (prompts are automatically stripped). - ``Control-Shift-c``: copy highlighted text to clipboard (prompts are not stripped). - ``Control-v``: paste text from clipboard. - ``Control-z``: undo (retrieves lost text if you move out of a cell with the arrows). - ``Control-Shift-z``: redo. - ``Control-o``: move to 'other' area, between pager and terminal. - ``Control-l``: clear terminal. - ``Control-a``: go to beginning of line. - ``Control-e``: go to end of line. - ``Control-u``: kill from cursor to the begining of the line. - ``Control-k``: kill from cursor to the end of the line. - ``Control-y``: yank (paste) - ``Control-p``: previous line (like up arrow) - ``Control-n``: next line (like down arrow) - ``Control-f``: forward (like right arrow) - ``Control-b``: back (like left arrow) - ``Control-d``: delete next character, or exits if input is empty - ``Alt-<``: move to the beginning of the input region. - ``alt->``: move to the end of the input region. - ``Alt-d``: delete next word. - ``Alt-Backspace``: delete previous word. - ``Control-.``: force a kernel restart (a confirmation dialog appears). - ``Control-+``: increase font size. - ``Control--``: decrease font size. - ``Control-Alt-Space``: toggle full screen. (Command-Control-Space on Mac OS X) The pager ========= The Jupyter QtConsole will show long blocks of text from many sources using a built-in pager. You can control where this pager appears with the ``--paging`` command-line flag: - ``inside`` [default]: the pager is overlaid on top of the main terminal. You must quit the pager to get back to the terminal (similar to how a pager such as ``less`` or ``more`` pagers behave). - ``vsplit``: the console is made double height, and the pager appears on the bottom area when needed. You can view its contents while using the terminal. - ``hsplit``: the console is made double width, and the pager appears on the right area when needed. You can view its contents while using the terminal. - ``none``: the console displays output without paging. If you use the vertical or horizontal paging modes, you can navigate between terminal and pager as follows: - Tab key: goes from pager to terminal (but not the other way around). - Control-o: goes from one to another always. - Mouse: click on either. In all cases, the ``q`` or ``Escape`` keys quit the pager (when used with the focus on the pager area). Running subprocesses ==================== When running a subprocess from the kernel, you can not interact with it as if it was running in a terminal. So anything that invokes a pager or expects you to type input into it will block and hang (you can kill it with ``Control-C``). The console can use magics provided by the IPython kernel. These magics include ``%less`` to page files (aliased to ``%more``), ``%clear`` to clear the terminal, and ``%man`` on Linux/OSX. These cover the most common commands you'd want to call in your subshell and that would cause problems if invoked via ``!cmd``, but you need to be aware of this limitation. Display ======= For example, if using the IPython kernel, there are functions available for object display: In [4]: from IPython.display import display In [5]: from IPython.display import display_png, display_svg Python objects can simply be passed to these functions and the appropriate representations will be displayed in the console as long as the objects know how to compute those representations. The easiest way of teaching objects how to format themselves in various representations is to define special methods such as: ``_repr_svg_`` and ``_repr_png_``. IPython's display formatters can also be given custom formatter functions for various types:: In [6]: ip = get_ipython() In [7]: png_formatter = ip.display_formatter.formatters['image/png'] In [8]: png_formatter.for_type(Foo, foo_to_png) For further details, see ``IPython.core.formatters``. N)