DECLL — Load LEDs (`CSI Ps q`, no SP intermediate)
Turn the keyboard's front-panel L1–L4 LEDs on / off (`CSI Ps q`). Surviving in Linux-console terminfo as `KEYBOARD_LED 1/2/3/4` — modern emulators silent no-op except xterm + Linux console.
Byte forms
Every common string-literal form so you can paste-and-search either direction.
\x1b[Ps q\033[Ps q\e[Ps qESC [ <Ps> q1b 5b <Ps> 71Description
**DECLL** (*Load LEDs*, `\x1b[<Ps>q`) controls the four front-panel keyboard LEDs (L1, L2, L3, L4) that DEC VT100-series terminals shipped with — small lamps just below the function-key row that the host could light to surface status (caps lock, mode flags, attention indicators). The sequence survives in 2026 only because the Linux console wired its three keyboard LEDs (NumLock, CapsLock, ScrollLock) to it, and terminfo's `KEYBOARD_LED 1`/`2`/`3` caps still expand to DECLL on `linux-*` entries. **The disambiguation trap.** DECLL is `CSI Ps q` with **no intermediate byte**. `dec-cursor-shape` (DECSCUSR) is `CSI Ps SP q` — note the **space (0x20) intermediate**. A parser that flattens whitespace will fuse the two and apply cursor-shape changes whenever the host wanted to toggle a status LED. The byte sequence `\x1b[3q` is DECLL 'L3 on'; `\x1b[3 q` (with the literal space) is DECSCUSR 'cursor blinking underline'. Real terminfo `setab` / `setaf` strings emit DECLL without the space; if you're writing a parser, key on the intermediate-byte slot, not on the final byte. **Parameter codes** (DEC VT100): - `0` — **All LEDs off** (the default if `Ps` omitted; also serves as a 'reset' from any partial-on state) - `1` — **L1 on** (NumLock on Linux console; 'L1' lamp on a real VT100) - `2` — **L2 on** (CapsLock on Linux console; 'L2' lamp on VT100) - `3` — **L3 on** (ScrollLock on Linux console; 'L3' lamp on VT100) - `4` — **L4 on** (no Linux mapping; 'L4' lamp on VT100 — historically used by host apps for 'attention needed') - `21` — **L1 off** (turn individual LED off without touching the others) - `22` — **L2 off** - `23` — **L3 off** - `24` — **L4 off** **Semantics.** DECLL is *additive* — `\x1b[1q` turns L1 on without touching L2/L3/L4 state. The 'turn off' codes (21–24) likewise act on a single LED. Only `\x1b[0q` (or `\x1b[q` with no parameter, which defaults `Ps` to 0) clears all four at once. **Edge cases** - Multiple parameters in one sequence are allowed: `\x1b[1;3q` turns L1 + L3 on, off-codes likewise compose: `\x1b[21;22;23q` turns L1, L2, L3 off in one trip. (Note this is one of the few cases where ECMA-48 'each Ps applies the same final-byte semantics' interpretation actually matches DEC's intent.) - The Linux-console kernel driver requires `CAP_SYS_TTY_CONFIG` to set LEDs from anything other than the kernel itself; ordinary user-space writes to `/dev/tty` honour DECLL only when the terminal type is `linux` and `loadkeys` hasn't remapped the LED bits. - On xterm, DECLL toggles tiny indicator dots in the title-bar area (configurable via the `showLed` X resource). Default is off (no visible effect) unless the user opts in. - **Do not confuse with**: `dec-cursor-shape` (CSI Ps SP q — adds space intermediate) or `xtversion` (CSI > q — adds `>` parameter prefix, no `Ps`). **Coverage** — **xterm** = full (with `showLed` X resource opt-in for visible feedback). **Linux console** = full (drives the three kernel-managed LEDs). **mlterm** + **Konsole** = partial (parse + acknowledge, no visible feedback unless an X resource is set). **WezTerm** + **iTerm2** + **Kitty** + **Alacritty** + **Ghostty** + **Windows Terminal** + **cmd / ConPTY** + **macOS Terminal** + **gnome-terminal** = no-op (parse silently and discard — no hardware LEDs to control in 2026's GUI emulators). In practice DECLL is invisible across the modern stack — use `osc-set-fg-bg` / `osc-cursor-color` / status-bar text for visible status indicators instead.
Spec citation: DEC VT100 User Guide §5.4 (DECLL) / ECMA-48 §8.3.69 (LL — Load LEDs)
Parameters
| Ps = 0 (default) | All LEDs off. Also the default if Ps omitted (\x1b[q). |
| Ps = 1..4 | Turn L1..L4 on (Linux console: L1=NumLock, L2=CapsLock, L3=ScrollLock, L4 unused). |
| Ps = 21..24 | Turn L1..L4 off individually without disturbing the other LEDs. |
| Multi-param | \x1b[1;3q lights L1+L3; \x1b[21;22q dims L1+L2 — semicolon-separated like SGR. |
Examples
# Light L1 (NumLock on Linux console).\nprintf '\\033[1q'\n# Light L1 + L3 in one shot.\nprintf '\\033[1;3q'\n# Clear all LEDs.\nprintf '\\033[0q'\n# Mind the disambiguation: \\x1b[3 q is DECSCUSR (cursor blinking underline), not DECLL.\nprintf '\\033[3q' # DECLL L3 on\nprintf '\\033[3 q' # DECSCUSR — note literal spaceimport sys\n# Use DECLL as a poor-man's status indicator on a serial console.\ndef set_leds(*on):\n if not on: sys.stdout.write('\\x1b[0q'); return\n sys.stdout.write('\\x1b[' + ';'.join(str(i) for i in on) + 'q')\n sys.stdout.flush()\nset_leds(1, 3) # L1 + L3 on\nset_leds() # all off// Toggle Linux console NumLock LED based on app state.\nfunc setNumLock(on bool) {\n if on {\n fmt.Print(\"\\x1b[1q\") // L1 on\n } else {\n fmt.Print(\"\\x1b[21q\") // L1 off (don't touch L2/L3)\n }\n}// Avoid the DECSCUSR collision: emit DECLL with NO space between Ps and 'q'.\nfunction decll(...ps) {\n const body = ps.length === 0 ? '0' : ps.join(';');\n process.stdout.write('\\x1b[' + body + 'q'); // no space — DECLL, not DECSCUSR\n}\ndecll(1, 3); // L1 + L3 on/* DECLL on Linux console — L1 corresponds to NumLock LED. */\n#include <stdio.h>\nvoid set_status_led(int led, int on) {\n if (on) printf(\"\\x1b[%dq\", led); /* 1..4 = on */\n else printf(\"\\x1b[%dq\", 20 + led); /* 21..24 = off */\n fflush(stdout);\n}Terminal support
- xterm
- yes
- Linux console (fbcon)
- yes
- macOS Terminal.app
- no
- iTerm2
- no
- Windows Terminal
- no
- cmd.exe / ConPTY
- no
- kitty
- no
- alacritty
- no
- WezTerm
- no
- Ghostty
- no
- GNOME Terminal
- no
- Konsole
- partial
- tmux
- no
- GNU screen
- no
| xterm | Linux console (fbcon) | macOS Terminal.app | iTerm2 | Windows Terminal | cmd.exe / ConPTY | kitty | alacritty | WezTerm | Ghostty | GNOME Terminal | Konsole | tmux | GNU screen |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| yes | yes | no | no | no | no | no | no | no | no | no | partial | no | no |