NUL Null
A byte that carries nothing and is ignored.
NUL
- ECMA-48
- §8.3.88 NUL – Null, p. 51
- DEC STD 070
- §5.9.1 C0 Control Characters, p. 5-128
- VT510
- 4.2 Control Characters
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. 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), so a NUL in the middle of one is ignored, and the sequence carries on around it.
Validation
NUL-1: Ignored between characters
A
\x00\x00
B
|AB___|
cursor 1,3
NUL-2: Ignored inside a control sequence
\e[\x002;3H # CUP, with a NUL after the CSI
X
|_____|
|__X__|