IL/DL
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
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
| Parameter | Description | Default |
|---|---|---|
Pn | Number of lines to insert or delete | 1 |
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
| Specification | Section |
|---|---|
| ECMA-48 | — |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✓ | 0.1.0 | Implemented via insert_blank_lines/delete_lines methods |
| Bobcat | ✓ | 0.9.0 | Supported via TerminalCtrl library |
| contour | ✓ | v0.1.0 | |
| foot | ✓ | Yes | IL (L) at csi.c:1047-1065, DL (M) at csi.c:1067-1085 |
| Ghostty | ✓ | v1.0.0 | |
| iTerm2 | ✓ | Yes | XTERMCC_INSLN and XTERMCC_DELLN tokens parsed and executed via terminalInsertBlankLinesAfterCursor and terminalDeleteLinesAtCursor |
| Kitty | ✓ | Yes | IL/DL (CSI L/M) fully implemented in vt-parser.c:1224-1227 |
| Konsole | ✓ | Yes | IL (L), DL (M) implemented at src/Vt102Emulation.cpp:2133-2134 |
| mintty | ✓ | Yes | IL (CSI L) at line 3221-3228, DL (CSI M) at line 3229-3236 |
| mlterm | ✓ | rel-2_9_0 | IL 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 | ✓ | Yes | Fully implemented in vteseq.cc as IL/DL handlers |
| WezTerm | ✓ | Yes | IL (InsertLine) and DL (DeleteLine) implemented as Edit::InsertLine and Edit::DeleteLine |
| Windows Terminal | ✓ | Yes | Implemented 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.6 | IL (CSI L) and DL (CSI M) both implemented |
| tuios | ✓ | v0.0.15 | |
| Zellij | ✓ | v0.1.0-alpha | |
See also
- ICH/DCH/ECH — Insert/Delete/Erase Characters — Character-level operations
- DECSTBM — Set Top and Bottom Margins — Defines the scrolling region
- SU/SD — Scroll Up/Down — Scroll without moving the cursor