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

Support parsing and ignoring private ANSI codes #57

Open
CosmicHorrorDev opened this issue Feb 24, 2025 · 0 comments
Open

Support parsing and ignoring private ANSI codes #57

CosmicHorrorDev opened this issue Feb 24, 2025 · 0 comments

Comments

@CosmicHorrorDev
Copy link
Collaborator

Of the remaining ANSI codes present in terminal_session.gz there are also several so-called "private" ANSI sequences. Private sequences start with a CSI (Control sequence Introducer) consisting of ESC [. These are all private ANSI codes from terminal_session.gz

  1. CSI ? 2004 h
  2. CSI ? 2004 l
  3. CSI ? 1 h
  4. CSI ? 1 l

From Wikipedia: ANSI escape code | Control Sequence Introducer commands

A subset of arrangements was declared "private" so that terminal manufacturers could insert their own sequences without conflicting with the standard. Sequences containing the parameter bytes <=>? or the final bytes 0x70–0x7E (p–z{|}~) are private.

1. and 2. appear to be the popular turn on and off bracketed paste mode respectively according to the aforementioned Wikipedia article. 3. and 4. appear to be cursor key mode commands according to the info listed in this gist

I'd imagine typically there isn't anything actionable we can typically do with private ANSI codes, so we should support parsing and subsequently excluding them from the converted HTML output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant