bracketed paste
also: paste bracketing, XTerm bracketed paste mode
A terminal feature that wraps pasted text with special escape sequences to distinguish it from keyboard input, preventing the shell from interpreting special characters or executing commands prematurely.
Bracketed paste is a terminal protocol that signals when text is being pasted rather than typed manually. When enabled, the terminal wraps pasted content between \033[200~ (paste start) and \033[201~ (paste end) escape sequences, allowing applications like shells and editors to handle pasted input safely.
Without bracketed paste, pasting a multi-line string containing special characters (like newlines or semicolons) could cause unintended command execution. For example, pasting rm -rf /tmp\necho done might execute both commands. With bracketed paste, the shell receives the entire block as a single unit and treats it literally.
Most modern terminals (xterm, GNOME Terminal, iTerm2) and shells (bash, zsh) support this feature automatically. It's particularly useful when pasting code snippets, configuration files, or any text containing shell metacharacters.