From d5927c22fa0c1f966862bbc868c30cd97d3322b9 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Thu, 11 Jun 2020 08:11:42 -0700 Subject: [PATCH] term: expand scope of Primary DA response We now claim to be vt320ish with support for selective erase and sixel graphics. refs: https://github.com/wez/wezterm/issues/217 --- term/src/lib.rs | 6 ------ term/src/terminalstate.rs | 7 ++++++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/term/src/lib.rs b/term/src/lib.rs index 3d5599c7d..8dec11cce 100644 --- a/term/src/lib.rs +++ b/term/src/lib.rs @@ -101,12 +101,6 @@ pub mod color; #[cfg(test)] mod test; -/// The response we given when queries for device attributes. -/// This particular string says "we are a VT102". -/// TODO: Consider VT220 extended response which can advertise -/// certain feature sets. -pub const DEVICE_IDENT: &[u8] = b"\x1b[?6c"; - pub const CSI: &str = "\x1b["; pub const OSC: &[u8] = b"\x1b]"; pub const ST: &[u8] = b"\x1b\\"; diff --git a/term/src/terminalstate.rs b/term/src/terminalstate.rs index 3ee281a0e..4d8b3f99c 100644 --- a/term/src/terminalstate.rs +++ b/term/src/terminalstate.rs @@ -1251,7 +1251,12 @@ impl TerminalState { // TODO: see https://vt100.net/docs/vt510-rm/DECSTR.html } Device::RequestPrimaryDeviceAttributes => { - self.writer.write(DEVICE_IDENT).ok(); + let mut ident = "\x1b[?63".to_string(); // Vt320 + ident.push_str(";4"); // Sixel graphics + ident.push_str(";6"); // Selective erase + ident.push('c'); + + self.writer.write(ident.as_bytes()).ok(); } Device::RequestSecondaryDeviceAttributes => { self.writer.write(b"\x1b[>0;0;0c").ok();