Skip to content

Main content

Terminal SGR Reset Group Audit

Audit reset-group occurrences in a simple SGR list without extended colors; 22 resets bold and faint together, 0 resets all supported style groups.

Loading tool…

Description

Audit reset-group occurrences in a simple SGR list without extended colors; 22 resets bold and faint together, 0 resets all supported style groups.

Terminal escape sequences can encode cursor commands, text styles and other controls inside ordinary text. SGR changes selected graphic attributes; CSI and OSC tokens have different framing. These tools operate on explicit strings and records, with a deliberately limited parser or style model rather than an emulated screen.1

Audit reset-group occurrences in a simple SGR list without extended colors; 22 resets bold and faint together, 0 resets all supported style groups.

When to use this tool

Use this tool to audit reset-group occurrences in a simple SGR list without extended colors; 22 resets bold and faint together, 0 resets all supported style groups.

How to use the tool and how it works

  1. Enter parameters using the field definitions below.
  2. Run the operation. Correct input errors before interpreting an output.
  3. Read result.resets. Use the ordering, boundary rules and absence conditions described below.

Inspect integer parameters and return positions of 0, 22, 23, 24, 27, 29, 39 and 49. Parameter 22 reports both bold and faint groups.2

Input fieldMeaning and unitsAccepted input
parametersExplicit numeric SGR parameters, in sequence order.Dense list of at most 128 finite numbers; integer/shape constraints above also apply.
Output fieldInterpretation
resultObject containing the named fields below.
result.resetsReset occurrences with input parameter index, value and affected group labels.
json
{
  "input": {
    "parameters": [
      1,
      22,
      0
    ]
  },
  "output": {
    "result": {
      "resets": [
        {
          "index": 1,
          "value": 22,
          "groups": [
            "bold",
            "faint"
          ]
        },
        {
          "index": 2,
          "value": 0,
          "groups": [
            "all"
          ]
        }
      ]
    }
  }
}

Limitations and assumptions

  • Extended-color introducers 38 and 48 are rejected; the remaining reset groups except 0 and 22 use numeric labels.
  • Source spans use zero-based UTF-16 offsets with exclusive ends; byte totals, where returned, use UTF-8. Escape tokens are represented as JSON escapes in the example and are not executed by this description.
  • Every declared top-level input field is required and unexpected fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
  • Numeric outputs must be finite and no larger in absolute magnitude than the safe-integer limit; operations returning exact large integers use decimal text. Positions are zero-based and spans end exclusively unless the operation explicitly states a different convention.

Alternative or Complementary methods

Use token inspection for source offsets and style replay for the supported attributes. A real terminal emulator is needed to determine screen contents, terminal-specific rendering or device behavior.

References

  1. ECMA-48: Control Functions for Coded Character Sets — Ecma International

  2. Tool behavior and example: Terminal SGR Reset Group Audit — tool.io

Similar or alternative tools