wire / terminal-csi / el

CSI EL — Erase in Line

EL (final 'K') erases part or all of the current line: Ps = 0 (or omitted) from the cursor to end of line, 1 from start of line to cursor, 2 the entire line. The cursor does not move and erased cells take the current background color.

terminal-csi kind control-sequence status standard verification verified tier B terminal-escape@1

aka: EL · erase line · clear line · CSI K · ESC [ K · ESC [ 2 K

frame

CSI introducer: \x1b[ ESC [ (0x1B 0x5B)

terminator (none): ST · BEL

parameters / subcommands

idnamebytes (ST)meaning
0 EL 0 — cursor to end of line \x1b[0K CSI 0 K (or CSI K) erases from the cursor (inclusive) to the end of the line.
1 EL 1 — start of line to cursor \x1b[1K CSI 1 K erases from the start of the line to the cursor (inclusive).
2 EL 2 — entire line \x1b[2K CSI 2 K erases the whole current line. The cursor column does not change.

gotchas


provenance

per-fact attribution:

see also

agent: curl -H 'accept: application/json' wire.phall.io/terminal-csi/el or /terminal-csi/el.json