Skip to main content

Module screen

Module screen 

Source
Expand description

Screen, line, scroll-region, and tab-stop manipulation.

§Category

This module emits CSI controls for erasing, inserting/deleting characters and lines, scrolling, setting vertical and horizontal margins, and tab-stop management.

§CSI conventions

Counted operations use the terminal default parameter where possible: for example n <= 1 emits ESC [ X for ECH and ESC [ L for IL. Erase operations use parameter 0 as the omitted default.

§Mode interaction

Left/right margins are interpreted as DECSLRM when Mode::LEFT_RIGHT_MARGIN is enabled. Top/bottom scroll margins are set by DECSTBM and affect absolute cursor movement when origin mode is active.

Constants§

ERASE_ENTIRE_DISPLAY
Erase the display including scrollback where supported: exact bytes ESC [ 3 J (ED 3).
ERASE_ENTIRE_LINE
Erase the entire current line: exact bytes ESC [ 2 K (EL 2).
ERASE_ENTIRE_SCREEN
Erase the visible screen: exact bytes ESC [ 2 J (ED 2).
ERASE_LINE_LEFT
Erase from start of line through cursor: exact bytes ESC [ 1 K (EL 1).
ERASE_LINE_RIGHT
Erase from cursor through end of line: exact bytes ESC [ K (EL 0).
ERASE_SCREEN_ABOVE
Erase from start of screen through cursor: exact bytes ESC [ 1 J (ED 1).
ERASE_SCREEN_BELOW
Erase from cursor through end of screen: exact bytes ESC [ J (ED 0).
HORIZONTAL_TAB_SET
Set a horizontal tab stop at the current column: exact bytes ESC H (HTS 7-bit form).
SET_TAB_EVERY_8_COLUMNS
Set tab stops every eight columns: exact bytes ESC [ ? 5 W (DECST8C).

Functions§

write_dch
Delete n character cells at the cursor with DCH.
write_delete_lines
Delete n lines with DL.
write_ech
Erase n character cells at the cursor with ECH.
write_ed
Erase in display with ED, ESC [ <n> J.
write_el
Erase in line with EL, ESC [ <n> K.
write_erase_below
Write ERASE_SCREEN_BELOW, ESC [ J, erasing from cursor through end of screen.
write_erase_line
Write ERASE_ENTIRE_LINE, ESC [ 2 K, erasing the entire current line.
write_erase_screen
Write ERASE_ENTIRE_SCREEN, ESC [ 2 J, erasing the visible screen.
write_erase_to_eol
Write ERASE_LINE_RIGHT, ESC [ K, erasing from cursor through end of line.
write_hts
Write HORIZONTAL_TAB_SET, ESC H, to set a tab stop at the current cursor column.
write_ich
Insert n blank character cells at the cursor with ICH.
write_insert_lines
Insert n blank lines with IL.
write_rep
Repeat the preceding printable character with REP.
write_reset_scroll_region
Reset top/bottom margins to the full screen with exact bytes ESC [ r.
write_reset_tab_stops_every_8
Reset tab stops to one every eight columns without DECST8C.
write_scroll_down
Scroll down by n lines with SD.
write_scroll_region
Set top and bottom margins with DECSTBM, ESC [ <top+1> ; <bottom+1> r.
write_scroll_up
Scroll up by n lines with SU.
write_set_left_right_margins
Set left and right margins with DECSLRM, ESC [ <left> ; <right> s.
write_tbc
Clear tab stops with TBC, ESC [ <n> g.