From 1252eaf15343306acaaec094165a5cd58a9cf9a1 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 18 Feb 2019 02:47:00 -0800 Subject: [PATCH] CMD-V -> paste --- term/src/terminalstate.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/term/src/terminalstate.rs b/term/src/terminalstate.rs index 229c14630..e94cd5e90 100644 --- a/term/src/terminalstate.rs +++ b/term/src/terminalstate.rs @@ -730,6 +730,16 @@ impl TerminalState { (Escape, ..) => "\x1b", // Delete (Char('\x7f'), ..) | (Delete, ..) => "\x1b[3~", + (Insert, _, _, SHIFT, _) | (Char('v'), ..) if mods == KeyModifiers::SUPER => { + let clip = host.get_clipboard()?; + if self.bracketed_paste { + write!(buf, "\x1b[200~{}\x1b[201~", clip)?; + } else { + buf = clip; + } + buf.as_str() + } + (Char(c), CTRL, _, SHIFT, _) if c <= 0xff as char && c > 0x40 as char => { // If shift is held we have C == 0x43 and want to translate // that into 0x03 @@ -751,15 +761,6 @@ impl TerminalState { buf.push(c); buf.as_str() } - (Insert, _, _, SHIFT, _) => { - let clip = host.get_clipboard()?; - if self.bracketed_paste { - write!(buf, "\x1b[200~{}\x1b[201~", clip)?; - } else { - buf = clip; - } - buf.as_str() - } (UpArrow, _, _, _, APPCURSOR) => "\x1bOA", (DownArrow, _, _, _, APPCURSOR) => "\x1bOB",