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

Strip problematic private escape sequences #3278

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

Commits on Feb 13, 2024

  1. Strip problematic private escape sequences:

    ["Private escape sequences"](https://en.wikipedia.org/wiki/ANSI_escape_code#Fp_Escape_sequences)
    are escape sequences that are reserved for private use, though `\x1b7` and
    `\x1b8` are commonly used for storing and restoring the current cursor
    position. When those escape codes are not stripped the cursor jumps around and
    causes Rich to write garbage output. An example of a program that uses this
    cursor store/restore functionality is the APK package manager in Alpine Linux:
    
    https://gitlab.alpinelinux.org/alpine/apk-tools/-/blob/48d91f482eb48a0a107b714ee183bb7e07782e14/src/print.c#L232-240
    
    This commit updates the ANSI parser to ignore the `\x1b0`-`\x1b?` escape
    sequences, thus preventing them from being printed and causing havoc.
    dosisod committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    f021979 View commit details
    Browse the repository at this point in the history