Skip to main content

IL/DL

AI-Generated Content
This page was generated with the assistance of AI and may contain inaccuracies. It is intended as a placeholder for future human verification. If you spot issues ahead of its initial review, please report them on GitHub!
Standard

IL (Insert Line) and DL (Delete Line) are CSI sequences that insert or delete lines at the cursor's current row within the scrolling region.

Syntax​

CSI Pn L      IL — Insert Line
CSI Pn M DL — Delete Line
Formal syntax
IL = 0x1b, "[", [ Pn ], "L" ;
DL = 0x1b, "[", [ Pn ], "M" ;
Pn = digit, { digit } ;                 (* default: 1 *)
digit = "0" | "1" | "2" | "3" | "4"
    | "5" | "6" | "7" | "8" | "9" ;

Parameters​

ParameterDescriptionDefault
PnNumber of lines to insert or delete1

Description​

IL — Insert Line (CSI Pn L)​

Per ECMA-48 §8.3.67, IL inserts Pn blank lines at the cursor's row. The current line and the lines below it within the scrolling region are shifted down. Lines pushed past the bottom margin of the scrolling region are lost. The cursor moves to column 1 of the current row.

DL — Delete Line (CSI Pn M)​

Per ECMA-48 §8.3.32, DL removes Pn lines starting at the cursor's row. Lines below the deleted range within the scrolling region are shifted up, and blank lines are added at the bottom margin. The cursor moves to column 1 of the current row.

Both operations are confined to the scrolling region set by DECSTBM. Lines outside the scrolling region are not affected.

Examples​

printf '\e[2L'       # Insert 2 blank lines at cursor row
printf '\e[3M' # Delete 3 lines starting at cursor row

Specifications​

SpecificationSection
ECMA-48—

Terminal support​

TerminalSupportVersionNotes
Terminal Emulators
Alacritty✓0.1.0Implemented via insert_blank_lines/delete_lines methods
Bobcat✓0.9.0Supported via TerminalCtrl library
contour✓v0.1.0
foot✓YesIL (L) at csi.c:1047-1065, DL (M) at csi.c:1067-1085
Ghostty✓v1.0.0
iTerm2✓YesXTERMCC_INSLN and XTERMCC_DELLN tokens parsed and executed via terminalInsertBlankLinesAfterCursor and terminalDeleteLinesAtCursor
Kitty✓YesIL/DL (CSI L/M) fully implemented in vt-parser.c:1224-1227
Konsole✓YesIL (L), DL (M) implemented at src/Vt102Emulation.cpp:2133-2134
mintty✓YesIL (CSI L) at line 3221-3228, DL (CSI M) at line 3229-3236
mlterm✓rel-2_9_0IL at vt_parser.c:5685-5692, DL at 5693-5700
PuTTY✓0.45
Rio✓v0.0.3
rxvt-unicode✓1.2
st✓0.1
terminology✓v0.1.0
VT100✗No
VTE✓YesFully implemented in vteseq.cc as IL/DL handlers
WezTerm✓YesIL (InsertLine) and DL (DeleteLine) implemented as Edit::InsertLine and Edit::DeleteLine
Windows Terminal✓YesImplemented in ITermDispatch.hpp:64-65 as InsertLine and DeleteLine
xterm✓xterm-406
xterm.js✓2.3.0
Multiplexers
cy✓v0.1.0
GNU Screen✓v.4.2.0
tmux✓1.6IL (CSI L) and DL (CSI M) both implemented
tuios✓v0.0.15
Zellij✓v0.1.0-alpha

See also​