mirror of
https://github.com/zellij-org/zellij.git
synced 2024-12-24 17:53:36 +03:00
fix(input): forward unknown keys to active terminal (#501)
* fix(input): forward unknown keys to active terminal * docs(changelog): update change
This commit is contained in:
parent
b93e51cf88
commit
8cdc7fbb69
@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
* Handle pasted text properly (https://github.com/zellij-org/zellij/pull/494)
|
||||
* Fix default keybinds for tab -> resize mode (https://github.com/zellij-org/zellij/pull/497)
|
||||
* Terminal compatibility: device reports (https://github.com/zellij-org/zellij/pull/500)
|
||||
* Forward unknown keys to the active terminal (https://github.com/zellij-org/zellij/pull/501)
|
||||
|
||||
## [0.9.0] - 2021-05-11
|
||||
* Add more functionality to unbinding the default keybindings (https://github.com/zellij-org/zellij/pull/468)
|
||||
|
@ -75,6 +75,10 @@ impl InputHandler {
|
||||
self.pasting = true;
|
||||
} else if unsupported_key == bracketed_paste_end {
|
||||
self.pasting = false;
|
||||
} else {
|
||||
// this is a hack because termion doesn't recognize certain keys
|
||||
// in this case we just forward it to the terminal
|
||||
self.handle_unknown_key(raw_bytes);
|
||||
}
|
||||
}
|
||||
termion::event::Event::Mouse(_) => {
|
||||
@ -87,6 +91,12 @@ impl InputHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
fn handle_unknown_key(&mut self, raw_bytes: Vec<u8>) {
|
||||
if self.mode == InputMode::Normal || self.mode == InputMode::Locked {
|
||||
let action = Action::Write(raw_bytes);
|
||||
self.dispatch_action(action);
|
||||
}
|
||||
}
|
||||
fn handle_key(&mut self, key: &Key, raw_bytes: Vec<u8>) {
|
||||
let keybinds = &self.config.keybinds;
|
||||
if self.pasting {
|
||||
|
Loading…
Reference in New Issue
Block a user