CMD-V -> paste

This commit is contained in:
Wez Furlong committed 2019-02-18 02:47:00 -08:00
1 parent 4aa1e65505
commit 1252eaf153
1 file changed
+10 -9
+10 -9
View File
@@ -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",