# Screen Alignment Test (DECALN)

> Fill the screen with the letter E.

- **Sequence:** `ESC # 8`
- **DEC STD 070:** [§D.8 Screen Alignment, p. D-19](https://archive.org/details/bitsavers_decstandar0VideoSystemsReferenceManualDec91_74264381/page/n1205/mode/1up)
- **VT510:** [DECALN—Screen Alignment Pattern](https://vt100.net/docs/vt510-rm/DECALN.html)

Fill every cell of the screen with an `E`. It was meant for adjusting the
focus and linearity of a CRT, and it lives on because it is the quickest way
to put something in every cell: many of the cases on this site start with it
before erasing or scrolling part of the screen.

Along the way it resets the top and bottom margins, and the left and right
ones, to the whole screen, and moves the cursor to the top-left.

## Validation

### DECALN-1: Fills the screen

Input, one step per line:

```text
\e[2;3H
\e#8
```

Expected screen:

```text
|EEEE|
|EEEE|
|EEEE|
cursor 1,1
```

### DECALN-2: Resets the scrolling region

Input, one step per line:

```text
\e[1;2r   # region is lines 1 and 2
\e#8
\e[2;1H
\n        # would scroll if the region were still set
```

Expected screen:

```text
|EEEE|
|EEEE|
|EEEE|
cursor 3,1
```

---

This is the Markdown version of <https://control-codes.page/esc/decaln/>. On that page every validation case runs live in libghostty-vt, the terminal emulation core of Ghostty, compiled to WebAssembly.

The validation cases are written in the notation described in <https://control-codes.page/notation/index.html.md>.
