Skip to main content

uncurses/ansi/
paste.rs

1//! Bracketed-paste delimiter sequences.
2//!
3//! ## Category
4//!
5//! These constants are the byte markers terminals send around pasted text when
6//! bracketed paste is enabled.
7//!
8//! ## CSI format
9//!
10//! The start marker is `ESC [ 200 ~`; the end marker is `ESC [ 201 ~`. Bytes
11//! between them are pasted data, not terminal control input.
12//!
13//! ## Mode interaction
14//!
15//! Enable or disable the reports with
16//! [`Mode::BRACKETED_PASTE`](crate::ansi::mode::Mode::BRACKETED_PASTE), DEC
17//! private mode 2004.
18
19/// Start delimiter for bracketed paste: exact bytes `ESC [ 200 ~` (`b"\x1b[200~"`).
20///
21/// Terminals send this before pasted payload when DEC private mode 2004 is enabled.
22pub const BRACKETED_PASTE_START: &[u8] = b"\x1b[200~";
23
24/// End delimiter for bracketed paste: exact bytes `ESC [ 201 ~` (`b"\x1b[201~"`).
25///
26/// Terminals send this after pasted payload when DEC private mode 2004 is enabled.
27pub const BRACKETED_PASTE_END: &[u8] = b"\x1b[201~";