C. Writing Termcap Descriptions : Eleven Basic Commands : Cursor Motion Command : Example 2: vt100
 
Share this page                  
Example 2: vt100
The cursor motion string for the VT100 is ESC[x;yH, where x and y are two‑digit integers specifying the column and row, respectively. The VT100, as opposed to Example 1 above, positions the cursor relative to a origin of (1,1). Thus, to move the cursor to column 8 row 17 on the VT100, enter ESC[08;17H. The termcap entry is:
cm=\E[%i%2;%2H
The \E maps to ESC, %2 maps to a decimal integer of two places, and the %i signifies that the VT100 uses a (1,1) origin. The default setting for the cm string is for a (0,0) origin. If your terminal uses a (1,1), origin you must explicitly state that by placing a %i somewhere inside the cm string.