Skip to content

Main content

Terminal CSI Cursor Position Formatter

Format an explicit one-based CSI CUP row/column position token; does not move a cursor or inspect screen dimensions.

Loading tool…

Description

Format an explicit one-based CSI CUP row/column position token; does not move a cursor or inspect screen dimensions.

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

Format an explicit one-based CSI CUP row/column position token; does not move a cursor or inspect screen dimensions.

When to use this tool

Use this tool to format an explicit one-based CSI CUP row/column position token; does not move a cursor or inspect screen dimensions.

How to use the tool and how it works

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

Require row and column integers from 1 through one million, then format ESC-bracket row-semicolon-column H.2

Input fieldMeaning and unitsAccepted input
rowOne-based cursor row.A finite safe integer within the operation’s stated bounds.
columnOne-based cursor column.A finite safe integer within the operation’s stated bounds.
Output fieldInterpretation
resultObject containing the named fields below.
result.tokenFormatted terminal control string; JSON escaping shows its control characters.
json
{
  "input": {
    "row": 2,
    "column": 3
  },
  "output": {
    "result": {
      "token": "\u001b[2;3H"
    }
  }
}

Limitations and assumptions

  • Coordinates are one-based; no terminal-size or screen-boundary check occurs.
  • 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 CSI Cursor Position Formatter — tool.io

Similar or alternative tools

  • 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.

  • Terminal CSI Erase Mode Token Parser

    Parse complete CSI erase-display/erase-line tokens with modes 0–2 or display-only mode 3; returns lexical evidence without terminal effects.