Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow copying with ANSI escape code control sequences #17059

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Oct 17, 2024

  1. Allow copying with ANSI escape code control sequences

    This extends the copy command to be able to include control sequences, for use in tools that subsequently know how to parse and display that.
    
    At a high level, this:
    - Expands the `CopyTextArgs` to have a `withControlSequences` bool.
    - Plumbs that bool down through many layers to where we actuall get data
      out of the text buffer.
    - Pulls out the core logic of `TextBuffer::Serialize` to a private `TextBuffer::_SerializeRow`.
    - Uses the new `_SerializeRow` to generate the data for the copy request.
    
    To test this I've manually:
    - Generated some styled terminal contents, copied it with the control sequences, pasted it into a file, `cat`ed the file and seen that it looks the same.
    - Set `"firstWindowPreference": "persistedWindowLayout"` and validated that the contents of windows are saved and restored with styling intact.
    FuegoFro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    2d1d192 View commit details
    Browse the repository at this point in the history