From be3ab90cffb3568766c7e6d7062bdbbbd3f1adca Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 10 Sep 2018 08:19:14 +0530 Subject: [PATCH] Add a reference to piping to the index page --- docs/index.rst | 8 ++++++++ kitty/config_data.py | 13 +++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 5c0d77593..b322f0aab 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -358,6 +358,14 @@ scrollback buffer in your favorite pager program (which is ``less`` by default). Colors and text formatting are preserved. You can explore the scrollback buffer comfortably within the pager. +Additionally, you can pipe the contents of the scrollback buffer to an +arbitrary, command running in a new window, tab or overlay, for example:: + + map f1 pipe @ansi window less +G -R + +Would open the scrollback buffer in a new window when you press the :kbd:`F1` +key. See :sc:`show_scrollback` for details. + Frequently Asked Questions --------------------------------- diff --git a/kitty/config_data.py b/kitty/config_data.py index 48635fe77..5119278b0 100644 --- a/kitty/config_data.py +++ b/kitty/config_data.py @@ -830,19 +830,20 @@ You can pipe the contents of the current screen + history buffer as :file:`STDIN` to an arbitrary program using the ``pipe`` function. For example, the following opens the scrollback buffer in less in an overlay window:: - map f1 pipe @ansi overlay less +g -R + map f1 pipe @ansi overlay less +G -R Placeholders available are: @text (which is plain text) and @ansi (which includes text styling escape codes). For only the current screen, use @screen or @ansi_screen. For the secondary screen, use @alternate and @ansi_alternate. -Note that the secondary screen is not currently displayed. For example if you -run a fullscreen terminal application, the secondary screen will be the screen -you return to when quitting the application. You can also use ``none`` for no -:file:`STDIN` input. +The secondary screen is the screen not currently displayed. For +example if you run a fullscreen terminal application, the secondary screen will +be the screen you return to when quitting the application. You can also use +``none`` for no :file:`STDIN` input. To open in a new window, tab or new OS window, use ``window``, ``tab``, or ``os_window`` respectively. You can also use ``none`` in which case the data -will be piped into the program without creating any windows. ''')) +will be piped into the program without creating any windows, useful if the +program is a GUI program that creates its own windows. ''')) # }}}