From 15f534a8f9d44d9873b07d8309db498aca7c6cd1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 29 Sep 2018 19:59:01 +0530 Subject: [PATCH] Add access to secondary screen scrollback via the pipe function --- kitty/boss.py | 4 ++++ kitty/config_data.py | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/kitty/boss.py b/kitty/boss.py index b0c71f3c3..73e1a8214 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -61,8 +61,12 @@ def data_for_at(w, arg): return w.as_text(as_ansi=True) if arg == '@alternate': return w.as_text(alternate_screen=True) + if arg == '@alternate_scrollback': + return w.as_text(alternate_screen=True, add_history=True) if arg == '@ansi_alternate': return w.as_text(as_ansi=True, alternate_screen=True) + if arg == '@ansi_alternate_scrollback': + return w.as_text(as_ansi=True, alternate_screen=True, add_history=True) class DumpCommands: # {{{ diff --git a/kitty/config_data.py b/kitty/config_data.py index 417c50304..dcc16edeb 100644 --- a/kitty/config_data.py +++ b/kitty/config_data.py @@ -858,12 +858,13 @@ the following opens the scrollback buffer in less in an overlay window:: 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. +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``. 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 +be the screen you return to when quitting the application. If you want access to the +secondary screen scrollback, use ``@alternate_scrollback``. 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