Skip to main content

write_decrpss

Function write_decrpss 

Source
pub fn write_decrpss<W: Write>(
    w: &mut W,
    valid: bool,
    settings: &str,
) -> Result<()>
Expand description

Encode a DECRPSS report, ESC P <ps> $ r <D...D> ESC \.

This is the terminal’s answer to write_decrqss. valid says whether the terminal recognized the request. settings is the control function being reported, spelled out as every character of its CSI sequence except the introducer: "0;4;5;7m" for SGR, "1;24r" for DECSTBM, "2 q" for DECSCUSR, ">4;2m" for xterm’s XTQMODKEYS. A terminal sends no data string at all for an invalid request, so false emits ESC P 0 $ r ESC \ and ignores settings.

Beware that the VT510 manual documents Ps the other way around, as 0 for valid and 1 for invalid. It is wrong: a VT420 tested in 1996 had the two reversed, and vttest, DEC STD 070 and xterm all treat 1 as the valid one.