Horizontal Position Relative (HPR)

Move the cursor to a specific column relative to the current position.

  1. 0x1B
    ESC
  2. 0x5B
    [
  3. ____
    x
  4. 0x61
    a

This sequence performs cursor position (CUP) with x set to the current cursor column plus x and y set to the current cursor row. There is no additional or different behavior for using HPR.

The parameter x must be an integer greater than or equal to 1. If x is less than or equal to 0, adjust x to be 1. If x is omitted, x defaults to 1.

Because this invokes CUP, the cursor row (y) can change if it is outside the bounds of the CUP operation. For example, if origin mode is set and the current cursor position is outside of the scroll region, the row will be adjusted.