Fix terminal key bindings (#12558)

Fixes https://github.com/zed-industries/zed/issues/12556

Only changed the keymap on Linux since I'm not sure if the behaviour is
correct on macOS

Release Notes:

- N/A
This commit is contained in:
apricotbucket28 2024-06-03 15:25:27 -03:00 committed by GitHub
parent be2df79d5c
commit 959f0dcded
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 6 deletions

View file

@ -642,12 +642,7 @@
"pagedown": ["terminal::SendKeystroke", "pagedown"],
"escape": ["terminal::SendKeystroke", "escape"],
"enter": ["terminal::SendKeystroke", "enter"],
"ctrl-c": ["terminal::SendKeystroke", "ctrl-c"],
// Some nice conveniences
"ctrl-backspace": ["terminal::SendText", "\u0015"],
"ctrl-right": ["terminal::SendText", "\u0005"],
"ctrl-left": ["terminal::SendText", "\u0001"]
"ctrl-c": ["terminal::SendKeystroke", "ctrl-c"]
}
}
]

View file

@ -54,6 +54,7 @@ pub fn to_esc_str(keystroke: &Keystroke, mode: &TermMode, alt_is_meta: bool) ->
("backspace", AlacModifiers::None) => Some("\x7f".to_string()),
//Interesting escape codes
("tab", AlacModifiers::Shift) => Some("\x1b[Z".to_string()),
("backspace", AlacModifiers::Ctrl) => Some("\x08".to_string()),
("backspace", AlacModifiers::Alt) => Some("\x1b\x7f".to_string()),
("backspace", AlacModifiers::Shift) => Some("\x7f".to_string()),
("space", AlacModifiers::Ctrl) => Some("\x00".to_string()),