# Format Effector Action Mode (FEAM)

> Whether formatting functions are performed or only stored.

- **Sequence:** `CSI 13 h`
- **ECMA-48:** [§7.2.5 FEAM – Format Effector Action Mode, p. 22](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n35/mode/1up)
- **DEC STD 070:** [§5.10.1.3 Modes That Cannot Be Changed, p. 5-134](https://archive.org/details/bitsavers_decstandar0VideoSystemsReferenceManualDec91_74264381/page/n388/mode/1up)

Mode 13 decides whether the formatting functions, ECMA-48's *formator
functions*, are performed when they arrive or only stored, to be performed by
another device later. They include [BS](https://control-codes.page/c0/bs/index.html.md), [CR](https://control-codes.page/c0/cr/index.html.md),
[HT](https://control-codes.page/c0/ht/index.html.md), [SGR](https://control-codes.page/csi/sgr/index.html.md) and the cursor positioning functions.

| State | ECMA-48 calls it | Meaning |
| --- | --- | --- |
| Reset, `CSI 13 l` | EXECUTE | they are performed, and may be stored as well |
| Set, `CSI 13 h` | STORE | they are stored but not performed |

[DEC STD 070 §5.10.1.3, p. 5-134](https://archive.org/details/bitsavers_decstandar0VideoSystemsReferenceManualDec91_74264381/page/n388/mode/1up) lists it among the X3.64 modes a DEC terminal may treat as fixed,
as reset. The VT510 manual's [table of modes for DECRPM](https://vt100.net/docs/vt510-rm/DECRPM.html) marks it as always reset.

xterm ignores `CSI 13 h` and `CSI 13 l` ([`ansi_modes`](https://github.com/ThomasDickey/xterm-snapshots/blob/xterm-411a/charproc.c#L7399-L7424) handles only modes 2,
4, 12 and 20), and [DECRQM](https://control-codes.page/csi/decrqm/index.html.md) reports the mode as permanently
reset, `4` ([`do_ansi_rqm`](https://github.com/ThomasDickey/xterm-snapshots/blob/xterm-411a/misc.c#L5408-L5463)). libghostty-vt ignores it too, but does not recognize the
number, so it answers DECRQM with `0`. Both DECRQM cases are known
differences.

## Validation

### FEAM-1: Reported as permanently reset

*A known difference: libghostty-vt does not pass this case.*

Input, one step per line:

```text
\e[13$p
```

Expected screen:

```text
|_____|
reply \e[13;4$y
```

### FEAM-2: Even after it is set

*A known difference: libghostty-vt does not pass this case.*

Input, one step per line:

```text
\e[13h
\e[13$p
```

Expected screen:

```text
|_____|
reply \e[13;4$y
```

### FEAM-3: CR is still performed

Input, one step per line:

```text
\e[13h     # ignored
AB
\r
C
```

Expected screen:

```text
|CB___|
cursor 1,2
```

---

This is the Markdown version of <https://control-codes.page/ansi/feam/>. On that page every validation case runs live in libghostty-vt, the terminal emulation core of Ghostty, compiled to WebAssembly.

The validation cases are written in the notation described in <https://control-codes.page/notation/index.html.md>.
