Improved F1 through F4 handling (#736)
This commit is contained in:
parent
bf9f78994a
commit
4383f8f010
@ -170,6 +170,13 @@ pub(crate) fn parse_csi(buffer: &[u8]) -> Result<Option<InternalEvent>> {
|
||||
b'I' => Some(Event::FocusGained),
|
||||
b'O' => Some(Event::FocusLost),
|
||||
b';' => return parse_csi_modifier_key_code(buffer),
|
||||
// P, Q, and S for compatibility with Kitty keyboard protocol,
|
||||
// as the 1 in 'CSI 1 P' etc. must be omitted if there are no
|
||||
// modifiers pressed:
|
||||
// https://sw.kovidgoyal.net/kitty/keyboard-protocol/#legacy-functional-keys
|
||||
b'P' => Some(Event::Key(KeyCode::F(1).into())),
|
||||
b'Q' => Some(Event::Key(KeyCode::F(2).into())),
|
||||
b'S' => Some(Event::Key(KeyCode::F(4).into())),
|
||||
b'0'..=b'9' => {
|
||||
// Numbered escape code.
|
||||
if buffer.len() == 3 {
|
||||
|
Loading…
Reference in New Issue
Block a user