Description
Inventory explicit OSC 8 open/close hyperlink target observations from complete seven-bit OSC tokens; parameters/targets remain literal, no URL resolution or rendering.
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
Inventory explicit OSC 8 open/close hyperlink target observations from complete seven-bit OSC tokens; parameters/targets remain literal, no URL resolution or rendering.
When to use this tool
Use this tool to inventory explicit OSC 8 open/close hyperlink target observations from complete seven-bit OSC tokens; parameters/targets remain literal, no URL resolution or rendering.
How to use the tool and how it works
- Enter text using the field definitions below.
- Run the operation. Correct input errors before interpreting an output.
- Read result.targets. Use the ordering, boundary rules and absence conditions described below.
Scan complete OSC tokens, retain those beginning with command 8, and split their parameter and target portions at the next semicolon.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| text | Source text or visible text, including actual escape characters where the operation inspects them. | Text, at most 8,192 UTF-16 code units; the operation’s grammar also applies. |
| Output field | Interpretation |
|---|---|
| result | Object containing the named fields below. |
| result.targets | OSC 8 target/parameter records with source spans; target may be empty for closure. |
{
"input": {
"text": "\u001b]8;;x\u0007"
},
"output": {
"result": {
"targets": [
{
"start": 0,
"end": 7,
"parameters": "",
"target": "x"
}
]
}
}
} Limitations and assumptions
- Empty targets represent hyperlink closure; extracted targets are not fetched or assessed for trust.
- 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
-
ECMA-48: Control Functions for Coded Character Sets — Ecma International
-
Tool behavior and example: Terminal OSC Hyperlink Target Inventory — tool.io
Similar or alternative tools
- Terminal OSC Hyperlink Record Formatter
Format one OSC 8 hyperlink record using ST delimiters, rejecting controls in target/display text; no URL safety, terminal support or link activation guarantee.
- Terminal CSI Cursor Move Formatter
Format a supported relative CSI cursor movement token with positive explicit count; directions are up/down/right/left only, no terminal execution.