Skip to content

Commit

Permalink
feat: unix term add Control-A (home), Control-E (end) and Control-H (…
Browse files Browse the repository at this point in the history
…8) support
  • Loading branch information
ttys3 committed Jan 23, 2021
1 parent cc3fcc1 commit 01fd493
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/unix_term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ pub fn read_single_key() -> io::Result<Key> {
'\n' | '\r' => Key::Enter,
'\x7f' => Key::Backspace,
'\t' => Key::Tab,
'\x01' => Key::Home, // Control-A (home)
'\x05' => Key::End, // Control-E (end)
'\x08' => Key::Backspace, // Control-H (8) (Identical to '\b')
_ => Key::Char(c),
})
}
Expand Down

0 comments on commit 01fd493

Please sign in to comment.