Skip to content

Bracketed paste (DECSET 2004)

Category: modes · Tags: DEC Private Modes, Xterm Extensions · Specification ↗

Bracketed paste mode wraps pasted text in special escape sequences so applications can distinguish pasted content from typed input. Enable with ESC [ ? 2004 h. When active, pasted text is bracketed between ESC [ 200 ~ (start) and ESC [ 201 ~ (end). This is a security feature: without bracketed paste, pasting text containing newlines into a shell prompt would immediately execute commands. With bracketed paste, the shell can treat the entire paste as literal text. This also enables editors to handle paste correctly — vim can enter paste mode automatically, preserving indentation rather than auto-indenting each line. Widely adopted. Most modern shells (bash, zsh, fish) and editors (vim, emacs) enable bracketed paste by default.

Supported by 6 of 6 backends (100%)

Support Matrix

BackendVersionSupportNotes
Alacritty0.26.0✓ yes
Ghostty1.3.1✓ yes
Kitty0.40.0✓ yes
vt1000.1.0✓ yes
WezTerm0.1.0-fork.5✓ yes
xterm.js5.5.0✓ yes

Powered by Termless
Playwright for Terminals