# Form Feed (FF)

> Move the cursor down one line, exactly as a line feed does.

- **Sequence:** `FF`
- **ECMA-48:** [§8.3.51 FF – Form Feed, p. 44](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n57/mode/1up)
- **DEC STD 070:** [§5.4.4 Form Feed, p. 5-62](https://archive.org/details/bitsavers_decstandar0VideoSystemsReferenceManualDec91_74264381/page/n316/mode/1up)
- **VT510:** [4.2 Control Characters](https://vt100.net/docs/vt510-rm/chapter4.html#S4.2)

On a terminal, FF (`0C`) is a [line feed](https://control-codes.page/c0/lf/index.html.md): the cursor moves down
one line in the same column, and the scrolling region scrolls up if the cursor
was on the bottom margin. With line feed/new line mode ([LNM](https://control-codes.page/csi/sm/index.html.md)) set,
it also returns to the first column, as a line feed does.

That is not what the standard says. ECMA-48 defines it as a move to the page home position of the next page or form, which is what a printer does with it. A terminal does not clear its screen or start a new page. DEC STD 070 calls a
terminal's FF a "fallback implementation", there for compatibility with
output meant for printers, and recommends that software send a line feed
instead. The VT510 manual says only that it is "treated as LF".

## Validation

### FF-1: Down, not back

Input, one step per line:

```text
AB
\f
C
```

Expected screen:

```text
|AB___|
|__C__|
|_____|
cursor 2,4
```

### FF-2: Scrolls at the bottom

Input, one step per line:

```text
A\r\nB\r\nC
\f
D
```

Expected screen:

```text
|B____|
|C____|
|_D___|
```

### FF-3: With line feed/new line mode

Input, one step per line:

```text
\e[20h    # LNM
AB
\f
C
\e[20l
```

Expected screen:

```text
|AB___|
|C____|
cursor 2,2
```

---

This is the Markdown version of <https://control-codes.page/c0/ff/>. 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>.
