# Null (NUL)

> A byte that carries nothing and is ignored.

- **Sequence:** `NUL`
- **ECMA-48:** [§8.3.88 NUL – Null, p. 51](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n64/mode/1up)
- **DEC STD 070:** [§5.9.1 C0 Control Characters, p. 5-128](https://archive.org/details/bitsavers_decstandar0VideoSystemsReferenceManualDec91_74264381/page/n382/mode/1up)
- **VT510:** [4.2 Control Characters](https://vt100.net/docs/vt510-rm/chapter4.html#S4.2)

NUL is fill. ECMA-48 says it "is used for media-fill or time-fill", and that
NULs "may be inserted into, or removed from, a data stream without affecting
the information content". DEC STD 070 likewise says it "may be used as a time
fill character".

A terminal ignores it. DEC STD 070 lists it as "Ignored on input (not stored
in input buffer)", the VT510 manual as having "no function (ignored by the
terminal)", and xterm's parser table maps it to
[`CASE_IGNORE`](https://github.com/ThomasDickey/xterm-snapshots/blob/xterm-411a/VTPrsTbl.c#L155-L156). DEC STD 070 makes one exception,
when its Control Representation Mode is set to display control characters
instead of acting on them.

A control character inside a sequence acts as if it had come just before the
sequence ([DEC STD 070 §3.5.1.1](https://archive.org/details/bitsavers_decstandar0VideoSystemsReferenceManualDec91_74264381/page/n122/mode/1up)), so a NUL in the middle
of one is ignored, and the sequence carries on around it.

## Validation

### NUL-1: Ignored between characters

Input, one step per line:

```text
A
\x00\x00
B
```

Expected screen:

```text
|AB___|
cursor 1,3
```

### NUL-2: Ignored inside a control sequence

Input, one step per line:

```text
\e[\x002;3H  # CUP, with a NUL after the CSI
X
```

Expected screen:

```text
|_____|
|__X__|
```

---

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