# No Clearing Screen On Column Change (DECNCSM)

> Keep DECCOLM from clearing the screen, on a VT510; a default xterm ignores it.

- **Sequence:** `CSI ? 95 h/l`
- **Defaults:** reset
- **VT510:** [DECNCSM—Set/Reset No Clearing Screen On Column Change](https://vt100.net/docs/vt510-rm/DECNCSM.html)
- **xterm:** [Functions using CSI](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html)

`CSI ? 95 h` stops a change of column mode clearing the screen, and
`CSI ? 95 l` lets it clear again. On a VT510, switching between 80 and 132
columns with [DECCOLM](https://control-codes.page/modes/deccolm/index.html.md), or in Set-Up, clears the screen as
a side effect unless this mode is set. The VT510 manual adds that the mode
has no effect on DECSCPP, which changes the columns per page without
clearing anything anyway. DEC STD 070 does not have the mode; the VT510
manual is the only DEC document that does.

xterm has the mode only when it emulates a VT510 or later
([`dpmodes`](https://github.com/ThomasDickey/xterm-snapshots/blob/xterm-411a/charproc.c#L7802-L7806),
[`do_dec_rqm`](https://github.com/ThomasDickey/xterm-snapshots/blob/xterm-411a/misc.c#L5637-L5642)).
A default xterm is a VT420, so it ignores `CSI ? 95 h`, answers DECRQM for
mode 95 with `0`, and DECCOLM goes on clearing the screen. The cases follow
it, as the [sources](https://control-codes.page/sources/index.html.md) page explains.

libghostty-vt does not have the mode either: it is not in the table in
`modes.zig`, and DECCOLM always clears. The cases pass.

## Support

| Terminal | Version | Support | Notes |
| --- | --- | --- | --- |
| VT220 | [manual](https://vt100.net/docs/vt220-rm/), 2nd ed., 1984 | No | not in the manual |
| VT510 | [manual](https://vt100.net/docs/vt510-rm/), 1st ed., 1993 | Yes | [DECNCSM](https://vt100.net/docs/vt510-rm/DECNCSM.html) |
| xterm | patch 412, [xterm-411a](https://github.com/ThomasDickey/xterm-snapshots/tree/xterm-411a) | No | only when emulating a VT510 or later; a default xterm, a VT420, ignores it and DECRQM reports `0` |
| libghostty-vt | [5dc28bb](https://github.com/ghostty-org/ghostty/tree/5dc28bb8eebaf57a6c793a406bfea8c632d4fa94) | No | not recognized, as in xterm |

## Validation

### DECNCSM-1: Not recognized

Input, one step per line:

```text
\e[?95$p
\e[?95h
\e[?95$p
```

Expected screen:

```text
|______|
reply \e[?95;0$y\e[?95;0$y
```

### DECNCSM-2: DECCOLM still clears the screen

Input, one step per line:

```text
\e[?40h   # allow 80/132
\e[?95h   # do not clear, on a VT510
ABC
\e[?3h    # 132 columns
```

Expected screen:

```text
|______|
|______|
cursor 1,1
```

---

This is the Markdown version of <https://control-codes.page/modes/decncsm/>. 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>.
