DECLRMM
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
DECLRMM (Mode 69) is a DECSET/DECRST mode that enables or disables left and right margins, allowing DECSLRM to define a horizontal scrolling region.
Syntax
CSI ? 69 h DECSET — Enable left/right margin mode
CSI ? 69 l DECRST — Disable left/right margin mode
Formal syntax
DECSET-mode69 = 0x1b, "[", "?", "6", "9", "h" ; DECRST-mode69 = 0x1b, "[", "?", "6", "9", "l" ;
Description
Per the VT420 and VT510 Programmer Reference manuals, DECLRMM (Left Right Margin Mode) controls whether the terminal recognizes left and right margins set by DECSLRM.
- Set — Left and right margins are enabled. DECSLRM (
CSI Pl ; Pr s) can be used to define the left and right margin columns. Printing, scrolling, and cursor movement are constrained within these margins. - Reset — Left and right margins are disabled. The left margin is fixed at column 1 and the right margin is fixed at the last column. This is the default.
Side effects
When DECLRMM is reset, any previously set left and right margins are cleared. The margins revert to the full width of the screen.
Interaction with other features
When left/right margins are active:
- Printing — Characters that reach the right margin wrap to the left margin of the next line (if DECAWM is set), rather than to column 1.
- Scrolling — IL, DL, SU, SD, and other scroll operations only affect the region within the left and right margins.
- Cursor movement — CUB stops at the left margin; CUF stops at the right margin. CUP coordinates are relative to the margins when DECOM is set.
- Erasure — EL erases within the full line width, but ICH, DCH, and ECH operate within the margins.
note
DECLRMM must be enabled before DECSLRM can set margins. If DECLRMM is off, the CSI Pl ; Pr s sequence is interpreted as SCP (Save Cursor Position) instead. This ambiguity between DECSLRM and SCP is a well-known source of compatibility issues.
Examples
printf '\e[?69h' # Enable left/right margin mode
printf '\e[10;70s' # Set left margin to column 10, right margin to column 70
# Text and scrolling are now confined to columns 10-70
printf '\e[?69l' # Disable left/right margin mode (margins cleared)
Specifications
| Specification | Section |
|---|---|
| VT510 Reference | — |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✗ | No | |
| Bobcat | ? | ? | Not explicitly configured in Bobcat. TerminalCtrl may support this, but cannot confirm from Bobcat's code. |
| contour | ✓ | v0.3.0.198 | Implemented as DECMode::LeftRightMargin at primitives.h:679, handled in Terminal.cpp:2283-2298 |
| foot | ✗ | No | |
| Ghostty | ✓ | v1.0.0 | |
| iTerm2 | ✓ | v20260216-nightly | Requires VT400 emulation level or higher |
| Kitty | ✗ | No | |
| Konsole | ✗ | No | |
| mintty | ✓ | Yes | Implemented at src/termout.c:2471 |
| mlterm | ✓ | rel-3_8_6 | |
| PuTTY | ✗ | No | |
| Rio | ✗ | No | Mentioned in comments as 'resets DECLRMM to unavailable' but not implemented |
| rxvt-unicode | ✗ | No | |
| st | ✗ | No | |
| terminology | ✓ | v1.1.0 | Uses termstate.lr_margins flag |
| VT100 | ✗ | No | |
| VTE | ✓ | Yes | |
| WezTerm | ✓ | Yes | |
| Windows Terminal | ✓ | Yes | DECLRMM_LeftRightMarginMode at adaptDispatch.cpp:1827-1836 |
| xterm | ✓ | 279 | VT420 feature, requires vtXX_level >= 4 |
| xterm.js | ✗ | No | |
| Multiplexers | |||
| cy | ✗ | No | |
| GNU Screen | ✗ | No | |
| tmux | ✗ | No | DECSLRM (set left/right margins) is used for output to terminals but mode 69 is not accepted as input |
| tuios | ✓ | v0.0.15 | |
| Zellij | ✗ | No | |
See also
- DECSLRM — Set Left and Right Margins — Sets the actual margin columns
- DECSTBM — Set Top and Bottom Margins — Vertical scrolling margins
- DECOM — Origin Mode — Cursor positioning relative to margins