mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-29 12:21:58 +00:00
Merge branch 'copilot/add-support-for-alternate-extents' of https://github.com/kovidgoyal/kitty
Fixes #10165
This commit is contained in:
commit
424d6f1ca4
2 changed files with 17 additions and 3 deletions
|
|
@ -176,6 +176,8 @@ Detailed list of changes
|
|||
0.50.0 [future]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- kitten @ get-text: Add support for :code:`alternate` and :code:`alternate_scrollback` extents to fetch text from the alternate screen buffer.
|
||||
|
||||
0.47.4 [2026-06-15]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
|||
|
|
@ -14,9 +14,10 @@ class GetText(RemoteCommand):
|
|||
|
||||
protocol_spec = __doc__ = '''
|
||||
match/str: The window to get text from
|
||||
extent/choices.screen.first_cmd_output_on_screen.last_cmd_output.last_visited_cmd_output.all.selection: \
|
||||
extent/choices.screen.first_cmd_output_on_screen.last_cmd_output.last_visited_cmd_output.all.selection.alternate.alternate_scrollback: \
|
||||
One of :code:`screen`, :code:`first_cmd_output_on_screen`, :code:`last_cmd_output`, \
|
||||
:code:`last_visited_cmd_output`, :code:`all`, or :code:`selection`
|
||||
:code:`last_visited_cmd_output`, :code:`all`, :code:`selection`, :code:`alternate`, \
|
||||
or :code:`alternate_scrollback`
|
||||
ansi/bool: Boolean, if True send ANSI formatting codes
|
||||
cursor/bool: Boolean, if True send cursor position/style as ANSI codes
|
||||
wrap_markers/bool: Boolean, if True add wrap markers to output
|
||||
|
|
@ -28,7 +29,7 @@ class GetText(RemoteCommand):
|
|||
options_spec = MATCH_WINDOW_OPTION + '''\n
|
||||
--extent
|
||||
default=screen
|
||||
choices=screen, all, selection, first_cmd_output_on_screen, last_cmd_output, last_visited_cmd_output, last_non_empty_output
|
||||
choices=screen, all, selection, first_cmd_output_on_screen, last_cmd_output, last_visited_cmd_output, last_non_empty_output, alternate, alternate_scrollback
|
||||
What text to get. The default of :code:`screen` means all text currently on the screen.
|
||||
:code:`all` means all the screen+scrollback and :code:`selection` means the
|
||||
currently selected text. :code:`first_cmd_output_on_screen` means the output of the first
|
||||
|
|
@ -37,6 +38,9 @@ the output of the last command that was run in the window. :code:`last_visited_c
|
|||
the first command output below the last scrolled position via scroll_to_prompt.
|
||||
:code:`last_non_empty_output` is the output from the last command run in the window that had
|
||||
some non empty output. The last four require :ref:`shell_integration` to be enabled.
|
||||
:code:`alternate` means the text in the screen that is not currently visible (if the terminal
|
||||
is in the main screen this is the secondary/alternate screen and vice versa).
|
||||
:code:`alternate_scrollback` is the same but also includes the scrollback buffer (if any).
|
||||
|
||||
|
||||
--ansi
|
||||
|
|
@ -112,6 +116,14 @@ Get text from the window this command is run in, rather than the active window.
|
|||
as_ansi=bool(payload_get('ansi')),
|
||||
add_wrap_markers=bool(payload_get('wrap_markers')),
|
||||
)
|
||||
elif payload_get('extent') in ('alternate', 'alternate_scrollback'):
|
||||
ans = window.as_text(
|
||||
as_ansi=bool(payload_get('ansi')),
|
||||
add_history=payload_get('extent') == 'alternate_scrollback',
|
||||
add_cursor=bool(payload_get('cursor')),
|
||||
add_wrap_markers=bool(payload_get('wrap_markers')),
|
||||
alternate_screen=True,
|
||||
)
|
||||
else:
|
||||
ans = window.as_text(
|
||||
as_ansi=bool(payload_get('ansi')),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue