Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Unreleased

- Key bindings for `ctrl_i` and `ctrl_[` in the config file are no longer
ignored and are now synonymous with `tab` and `esc`. (#444)
- The keystrokes `ctrl_h` and `backspace` can now be distinguished, which
allows the user to define separate key bindings in the config file. (#445)

# 2025/01/01: 0.13.0

- Improve nick matching to avoid highlighting message incorrectly. (#430)
Expand Down
13 changes: 12 additions & 1 deletion crates/libtiny_tui/src/key_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,18 @@ impl<'de> Deserialize<'de> for MappedKey {
} else if let Some(f_key) = parse_f_key(k2) {
Key::CtrlF(f_key)
} else {
Key::Ctrl(single_key(k2)?)
match single_key(k2)? {
// NOTE: The following special mappings are needed
// because, e.g., `Key::Ctrl('i')` is never generated
// by `term_input` since `ctrl_i` and `tab` send
// identical bytes and hence cannot be distinguished
// in a terminal app. Having the special mapping here
// allows the user to define a working key binding for
// `ctrl_i`, which would otherwise be ignored.
'i' => Key::Tab,
'[' => Key::Esc,
other => Key::Ctrl(other),
}
}
}
"shift" => {
Expand Down
Loading