From d778d8b1306ef9d5fb09d9cc8e70e648a79a8b33 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 23 Nov 2019 15:04:54 -0800 Subject: [PATCH] disable csi-u sequences by default I keep holding shift while pressing space and seeing stuff get undone in vim. Super annoying. I didn't see a good way to teach applications about this via terminfo, so this is off by default for now. refs: https://github.com/wez/wezterm/issues/63 --- term/src/terminalstate.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/term/src/terminalstate.rs b/term/src/terminalstate.rs index 78c6078be..2aad534ea 100644 --- a/term/src/terminalstate.rs +++ b/term/src/terminalstate.rs @@ -862,7 +862,12 @@ impl TerminalState { // TODO: also respect self.application_keypad fn csi_u_encode(buf: &mut String, c: char, mods: KeyModifiers) -> Result<(), Error> { - write!(buf, "\x1b[{};{}u", c as u32, 1 + encode_modifiers(mods))?; + // FIXME: provide an option to enable this, because it is super annoying + // in vim when accidentally pressing shift-space and it emits a sequence + // that undoes some number of commands + if false { + write!(buf, "\x1b[{};{}u", c as u32, 1 + encode_modifiers(mods))?; + } Ok(()) }