summaryrefslogtreecommitdiffstats
path: root/zellij-client/src
diff options
context:
space:
mode:
authorThomas Linford <tlinford@users.noreply.github.com>2022-03-09 21:21:15 +0100
committerGitHub <noreply@github.com>2022-03-09 21:21:15 +0100
commit7e008bb0396eb130c4bc4fb62240566bf6feda9f (patch)
treecf2d42d56bab931a2d03fee38c31ffb21007626f /zellij-client/src
parent2b89b63eb7030dc26256b74154c86a9de1cf6035 (diff)
fix(compatibility): home and end in cursor keys mode (#1190)
Diffstat (limited to 'zellij-client/src')
-rw-r--r--zellij-client/src/stdin_handler.rs26
1 files changed, 0 insertions, 26 deletions
diff --git a/zellij-client/src/stdin_handler.rs b/zellij-client/src/stdin_handler.rs
index 3abb497a1..965100f87 100644
--- a/zellij-client/src/stdin_handler.rs
+++ b/zellij-client/src/stdin_handler.rs
@@ -1,34 +1,10 @@
use crate::os_input_output::ClientOsApi;
use crate::InputInstruction;
-use std::collections::HashMap;
-use terminfo::{capability as cap, Database as TerminfoDatabase};
use termion::input::TermReadEventsAndRaw;
use zellij_utils::channels::SenderWithContext;
use zellij_utils::input::mouse::MouseEvent;
use zellij_utils::termion;
-fn keys_to_adjust() -> HashMap<Vec<u8>, Vec<u8>> {
- let mut keys_to_adjust = HashMap::new();
- if let Ok(terminfo_db) = TerminfoDatabase::from_env() {
- // TODO: there might be more adjustments we can do here, but I held off on them because I'm
- // not sure they're a thing in these modern times. It should be pretty straightforward to
- // implement them if they are...
- if let Some(adjusted_home_key) = terminfo_db
- .get::<cap::KeyHome>()
- .and_then(|k| k.expand().to_vec().ok())
- {
- keys_to_adjust.insert(vec![27, 91, 72], adjusted_home_key);
- }
- if let Some(adjusted_end_key) = terminfo_db
- .get::<cap::KeyEnd>()
- .and_then(|k| k.expand().to_vec().ok())
- {
- keys_to_adjust.insert(vec![27, 91, 70], adjusted_end_key);
- }
- }
- keys_to_adjust
-}
-
pub(crate) fn stdin_loop(
os_input: Box<dyn ClientOsApi>,
send_input_instructions: SenderWithContext<InputInstruction>,
@@ -38,7 +14,6 @@ pub(crate) fn stdin_loop(
let bracketed_paste_start = termion::event::Event::Unsupported(vec![27, 91, 50, 48, 48, 126]); // \u{1b}[200~
let bracketed_paste_end = termion::event::Event::Unsupported(vec![27, 91, 50, 48, 49, 126]); // \u{1b}[201~
let csi_mouse_sgr_start = vec![27, 91, 60];
- let adjusted_keys = keys_to_adjust();
for key_result in os_input.get_stdin_reader().events_and_raw() {
let (key_event, mut raw_bytes) = key_result.unwrap();
@@ -59,7 +34,6 @@ pub(crate) fn stdin_loop(
continue;
}
- let raw_bytes = adjusted_keys.get(&raw_bytes).cloned().unwrap_or(raw_bytes);
if let termion::event::Event::Mouse(me) = key_event {
let mouse_event = zellij_utils::input::mouse::MouseEvent::from(me);
if let MouseEvent::Hold(_) = mouse_event {