Back to Ghostty Org

Screen Alignment Test (DECALN)

docs/vt/esc/decaln.mdx

latest760 B
Original Source

<VTSequence sequence={["ESC", "#", "8"]} />

Reset the top, bottom, left, and right margins and unset origin mode. The cursor is moved to the top-left corner of the screen.

All stylistic SGR attributes are unset, such as bold, blink, etc. SGR foreground and background colors are preserved. The protected attribute is not unset.

The entire screen is filled with the character E. The letter E ignores the current SGR settings and is written with no styling.

Validation

DECALN V-1: Simple Usage

bash
printf "\033#8"
|EEEEEEEE|
|EEEEEEEE|
|EEEEEEEE|

DECALN V-2: Reset Margins

bash
printf "\033[2;3r" # scroll region top/bottom
printf "\033#8"
printf "\033[T"
|c_______|
|EEEEEEEE|
|EEEEEEEE|