1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-24 07:46:59 +03:00

remap Char codes to termwiz input codes

refs: https://github.com/wez/wezterm/issues/53
This commit is contained in:
Wez Furlong 2019-10-28 14:29:24 -07:00
parent 61fe33fbf6
commit a9940ca56f

View File

@ -185,6 +185,13 @@ impl WindowCallbacks for TermWindow {
use ::window::KeyCode as WK;
let key_down = match key.key {
// TODO: consider eliminating these codes from termwiz::input::KeyCode
WK::Char('\r') | WK::Char('\n') => Some(KC::Enter),
WK::Char('\t') => Some(KC::Tab),
WK::Char('\u{08}') => Some(KC::Backspace),
WK::Char('\u{1b}') => Some(KC::Escape),
WK::Char('\u{7f}') => Some(KC::Delete),
WK::Char(c) => Some(KC::Char(c)),
WK::Composed(ref s) => {
tab.writer().write_all(s.as_bytes()).ok();