Skip to content

Commit a8c1e42

Browse files
committed
Add docs for multicell + control codes
1 parent 21ded18 commit a8c1e42

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

docs/text-sizing-protocol.rst

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,3 +262,46 @@ There are many controls used to edit existing screen content such as
262262
inserting characters, deleting characters and lines, etc. These were all
263263
originally specified for the one character per cell paradigm. Here we specify
264264
their interactions with multicell characters.
265+
266+
**Insert characters** (``CSI @`` aka ``ICH``)
267+
When inserting ``n`` characters at cursor position ``x, y`` all characters
268+
after ``x`` on line ``y`` are supposed to be right shifted. This means
269+
that any multiline character that intersects with the cells on line ``y`` at ``x``
270+
and beyond must be erased. Any single line multicell character that is
271+
split by the cells at ``x`` and ``x + n - 1`` must also be erased.
272+
273+
**Delete characters** (``CSI P`` aka ``DCH``)
274+
When deleting ``n`` characters at cursor position ``x, y`` all characters
275+
after ``x`` on line ``y`` are supposed to be left shifted. This means
276+
that any multiline character that intersects with the cells on line ``y`` at ``x``
277+
and beyond must be erased. Any single line multicell character that is
278+
split by the cells at ``x`` and ``x + n - 1`` must also be erased.
279+
280+
**Erase characters** (``CSI X`` aka ``ECH``)
281+
When erasing ``n`` characters at cursor position ``x, y`` the ``n`` cells
282+
starting at ``x`` are supposed ot be cleared. This means that any multicell
283+
character that intersects with the ``n`` cells starting at ``x`` must be
284+
erased.
285+
286+
**Erase display** (``CSI J`` aka ``ED``)
287+
Any multicell character intersecting with the erased region of the screen
288+
must be erased. When using mode ``22`` the contents of the screen are first
289+
copied into the scrollback, including all multicell characters.
290+
291+
**Erase in line** (``CSI K`` aka ``EL``)
292+
Works just like erase characters above. Any multicell character
293+
intersecting with the erased cells in the line is erased.
294+
295+
**Insert lines** (``CSI L`` aka ``IL``)
296+
When inserting ``n`` lines at cursor position ``y`` any multiline
297+
characters that are split at the line ``y`` must be erased. A split happens
298+
when the second or subsequent row of the multiline character is on the line
299+
``y``. The insertion causes ``n`` lines to be removed from the bottom of
300+
the screen, any multiline characters are split at the bottom of the screen
301+
must be erased. A split is when any row of the multiline character except
302+
the last row is on the last line of the screen after the insertion of ``n``
303+
lines.
304+
305+
**Delete lines** (``CSI M`` aka ``DL``)
306+
When deleting ``n`` lines at cursor position ``y`` any multicell character
307+
that intersects the deleted lines must be erased.

0 commit comments

Comments
 (0)