SRM Send/Receive Mode
Turn local echo off and on.
CSI 12 h/l
- ECMA-48
- §7.2.15 SRM – Send/Receive Mode, p. 24
- DEC STD 070
- §5.10.2 Send Receive Mode, p. 5-135
- VT220
- §4.6.5 Send/Receive Mode (SRM)
- VT510
- SRM—Local Echo: Send/Receive Mode
- xterm
- Functions using CSI
Mode 12 is local echo. Reset (CSI 12 l), what is typed is shown on the screen by the terminal itself as well as being sent; set (CSI 12 h), it is only sent, and the host echoes it if it wants it seen.
| State | ECMA-48 calls it | Meaning |
|---|---|---|
Reset, CSI 12 l | MONITOR | what is typed is shown at once |
Set, CSI 12 h | SIMULTANEOUS | only what the host sends is shown |
Unusually, the set state is the default. ECMA-48 recommends that every mode start reset, but DEC STD 070 (§5.10.2, p. 5-135) and the VT510 manual make no local echo the default, and so does xterm: it sets the mode when it starts and on a reset (charproc.c).
xterm keeps the mode, and when it is reset, it parses what it sends as if the host had sent it (charproc.c). That is input, which this site cannot type, so nothing on the screen changes here. libghostty-vt keeps the mode, set by default, and both answer DECRQM with its state.
Support
| Terminal | Version | Support | Notes |
|---|---|---|---|
| VT220 | manual, 2nd ed., 1984 | Yes | §4.6.5 Send/Receive Mode (SRM) |
| VT510 | manual, 1st ed., 1993 | Yes | SRM |
| xterm | patch 412, xterm-411a | Yes | |
| libghostty-vt | 0f171f6 | Yes | |
| kitty | 0.49.1, run in a VM | No | fails the 3 cases that show it working |
| foot | 1.28.0, run in a VM | No | fails the 3 cases that show it working |
| xterm.js headless | 6.0.0, run as a library | No | fails the 3 cases that show it working |
| alacritty_terminal | 0.26.0, run as a library | No | fails the 3 cases that show it working |
| ConEmu | build 230724, its documentation | No | not in its ANSI escape codes |
| rxvt-unicode | 9.31, run in a VM | No | fails the 3 cases that show it working |
| VTE | 0.84.1, run as a library | No | fails the 3 cases that show it working |
Validation
SRM-1: Set by default
\e[12$p
|_____|
reply \e[12;1$y
SRM-2: Reset
\e[12l
\e[12$p
|_____|
reply \e[12;2$y
SRM-3: And set again
\e[12l
\e[12h
\e[12$p
|_____|
reply \e[12;1$y