Revert terminal: Add Alt key bindings for terminal (#15535)
- reverts commit 66ada3e44c
.
- change default `option_as_meta` to true
This commit is contained in:
parent
9384f665bb
commit
64bfec533e
4 changed files with 3 additions and 100 deletions
|
@ -635,7 +635,7 @@
|
||||||
// "option_to_meta": false,
|
// "option_to_meta": false,
|
||||||
// 2. Make the option keys behave as a 'meta' key, e.g. for emacs
|
// 2. Make the option keys behave as a 'meta' key, e.g. for emacs
|
||||||
// "option_to_meta": true,
|
// "option_to_meta": true,
|
||||||
"option_as_meta": false,
|
"option_as_meta": true,
|
||||||
// Whether or not selecting text in the terminal will automatically
|
// Whether or not selecting text in the terminal will automatically
|
||||||
// copy to the system clipboard.
|
// copy to the system clipboard.
|
||||||
"copy_on_select": false,
|
"copy_on_select": false,
|
||||||
|
|
|
@ -192,103 +192,6 @@ pub fn to_esc_str(keystroke: &Keystroke, mode: &TermMode, alt_is_meta: bool) ->
|
||||||
("^", AlacModifiers::Ctrl) => Some("\x1e".to_string()), //30
|
("^", AlacModifiers::Ctrl) => Some("\x1e".to_string()), //30
|
||||||
("_", AlacModifiers::Ctrl) => Some("\x1f".to_string()), //31
|
("_", AlacModifiers::Ctrl) => Some("\x1f".to_string()), //31
|
||||||
("?", AlacModifiers::Ctrl) => Some("\x7f".to_string()), //127
|
("?", AlacModifiers::Ctrl) => Some("\x7f".to_string()), //127
|
||||||
// Mapping of Alt+key; emacs meta key: M-
|
|
||||||
("a", AlacModifiers::Alt) => Some("\x1ba".to_string()),
|
|
||||||
("A", AlacModifiers::Alt) => Some("\x1bA".to_string()),
|
|
||||||
("b", AlacModifiers::Alt) => Some("\x1bb".to_string()),
|
|
||||||
("B", AlacModifiers::Alt) => Some("\x1bB".to_string()),
|
|
||||||
("c", AlacModifiers::Alt) => Some("\x1bc".to_string()),
|
|
||||||
("C", AlacModifiers::Alt) => Some("\x1bC".to_string()),
|
|
||||||
("d", AlacModifiers::Alt) => Some("\x1bd".to_string()),
|
|
||||||
("D", AlacModifiers::Alt) => Some("\x1bD".to_string()),
|
|
||||||
("e", AlacModifiers::Alt) => Some("\x1be".to_string()),
|
|
||||||
("E", AlacModifiers::Alt) => Some("\x1bE".to_string()),
|
|
||||||
("f", AlacModifiers::Alt) => Some("\x1bf".to_string()),
|
|
||||||
("F", AlacModifiers::Alt) => Some("\x1bF".to_string()),
|
|
||||||
("g", AlacModifiers::Alt) => Some("\x1bg".to_string()),
|
|
||||||
("G", AlacModifiers::Alt) => Some("\x1bG".to_string()),
|
|
||||||
("h", AlacModifiers::Alt) => Some("\x1bh".to_string()),
|
|
||||||
("H", AlacModifiers::Alt) => Some("\x1bH".to_string()),
|
|
||||||
("i", AlacModifiers::Alt) => Some("\x1bi".to_string()),
|
|
||||||
("I", AlacModifiers::Alt) => Some("\x1bI".to_string()),
|
|
||||||
("j", AlacModifiers::Alt) => Some("\x1bj".to_string()),
|
|
||||||
("J", AlacModifiers::Alt) => Some("\x1bJ".to_string()),
|
|
||||||
("k", AlacModifiers::Alt) => Some("\x1bk".to_string()),
|
|
||||||
("K", AlacModifiers::Alt) => Some("\x1bK".to_string()),
|
|
||||||
("l", AlacModifiers::Alt) => Some("\x1bl".to_string()),
|
|
||||||
("L", AlacModifiers::Alt) => Some("\x1bL".to_string()),
|
|
||||||
("m", AlacModifiers::Alt) => Some("\x1bm".to_string()),
|
|
||||||
("M", AlacModifiers::Alt) => Some("\x1bM".to_string()),
|
|
||||||
("n", AlacModifiers::Alt) => Some("\x1bn".to_string()),
|
|
||||||
("N", AlacModifiers::Alt) => Some("\x1bN".to_string()),
|
|
||||||
("o", AlacModifiers::Alt) => Some("\x1bo".to_string()),
|
|
||||||
("O", AlacModifiers::Alt) => Some("\x1bO".to_string()),
|
|
||||||
("p", AlacModifiers::Alt) => Some("\x1bp".to_string()),
|
|
||||||
("P", AlacModifiers::Alt) => Some("\x1bP".to_string()),
|
|
||||||
("q", AlacModifiers::Alt) => Some("\x1bq".to_string()),
|
|
||||||
("Q", AlacModifiers::Alt) => Some("\x1bQ".to_string()),
|
|
||||||
("r", AlacModifiers::Alt) => Some("\x1br".to_string()),
|
|
||||||
("R", AlacModifiers::Alt) => Some("\x1bR".to_string()),
|
|
||||||
("s", AlacModifiers::Alt) => Some("\x1bs".to_string()),
|
|
||||||
("S", AlacModifiers::Alt) => Some("\x1bS".to_string()),
|
|
||||||
("t", AlacModifiers::Alt) => Some("\x1bt".to_string()),
|
|
||||||
("T", AlacModifiers::Alt) => Some("\x1bT".to_string()),
|
|
||||||
("u", AlacModifiers::Alt) => Some("\x1bu".to_string()),
|
|
||||||
("U", AlacModifiers::Alt) => Some("\x1bU".to_string()),
|
|
||||||
("v", AlacModifiers::Alt) => Some("\x1bv".to_string()),
|
|
||||||
("V", AlacModifiers::Alt) => Some("\x1bV".to_string()),
|
|
||||||
("w", AlacModifiers::Alt) => Some("\x1bw".to_string()),
|
|
||||||
("W", AlacModifiers::Alt) => Some("\x1bW".to_string()),
|
|
||||||
("x", AlacModifiers::Alt) => Some("\x1bx".to_string()),
|
|
||||||
("X", AlacModifiers::Alt) => Some("\x1bX".to_string()),
|
|
||||||
("y", AlacModifiers::Alt) => Some("\x1by".to_string()),
|
|
||||||
("Y", AlacModifiers::Alt) => Some("\x1bY".to_string()),
|
|
||||||
("z", AlacModifiers::Alt) => Some("\x1bz".to_string()),
|
|
||||||
("Z", AlacModifiers::Alt) => Some("\x1bZ".to_string()),
|
|
||||||
// Emacs Numeric arguments / prefix arguments
|
|
||||||
("0", AlacModifiers::Alt) => Some("\x1b0".to_string()),
|
|
||||||
("1", AlacModifiers::Alt) => Some("\x1b1".to_string()),
|
|
||||||
("2", AlacModifiers::Alt) => Some("\x1b2".to_string()),
|
|
||||||
("3", AlacModifiers::Alt) => Some("\x1b3".to_string()),
|
|
||||||
("4", AlacModifiers::Alt) => Some("\x1b4".to_string()),
|
|
||||||
("5", AlacModifiers::Alt) => Some("\x1b5".to_string()),
|
|
||||||
("6", AlacModifiers::Alt) => Some("\x1b6".to_string()),
|
|
||||||
("7", AlacModifiers::Alt) => Some("\x1b7".to_string()),
|
|
||||||
("8", AlacModifiers::Alt) => Some("\x1b8".to_string()),
|
|
||||||
("9", AlacModifiers::Alt) => Some("\x1b9".to_string()),
|
|
||||||
// Various Emacs Meta key combinations
|
|
||||||
("!", AlacModifiers::Alt) => Some("\x1b!".to_string()),
|
|
||||||
// ("\"", AlacModifiers::Alt) => Some("\x1b\"".to_string()),
|
|
||||||
// ("#", AlacModifiers::Alt) => Some("\x1b#".to_string()),
|
|
||||||
("$", AlacModifiers::Alt) => Some("\x1b$".to_string()),
|
|
||||||
("%", AlacModifiers::Alt) => Some("\x1b%".to_string()),
|
|
||||||
("&", AlacModifiers::Alt) => Some("\x1b&".to_string()),
|
|
||||||
("'", AlacModifiers::Alt) => Some("\x1b'".to_string()),
|
|
||||||
("(", AlacModifiers::Alt) => Some("\x1b(".to_string()),
|
|
||||||
(")", AlacModifiers::Alt) => Some("\x1b)".to_string()),
|
|
||||||
// ("*", AlacModifiers::Alt) => Some("\x1b*".to_string()),
|
|
||||||
// ("+", AlacModifiers::Alt) => Some("\x1b+".to_string()),
|
|
||||||
(",", AlacModifiers::Alt) => Some("\x1b,".to_string()),
|
|
||||||
("-", AlacModifiers::Alt) => Some("\x1b-".to_string()),
|
|
||||||
(".", AlacModifiers::Alt) => Some("\x1b.".to_string()),
|
|
||||||
("/", AlacModifiers::Alt) => Some("\x1b/".to_string()),
|
|
||||||
(":", AlacModifiers::Alt) => Some("\x1b:".to_string()),
|
|
||||||
(";", AlacModifiers::Alt) => Some("\x1b;".to_string()),
|
|
||||||
("<", AlacModifiers::Alt) => Some("\x1b<".to_string()),
|
|
||||||
("=", AlacModifiers::Alt) => Some("\x1b=".to_string()),
|
|
||||||
(">", AlacModifiers::Alt) => Some("\x1b>".to_string()),
|
|
||||||
("?", AlacModifiers::Alt) => Some("\x1b?".to_string()),
|
|
||||||
("@", AlacModifiers::Alt) => Some("\x1b@".to_string()),
|
|
||||||
// ("[", AlacModifiers::Alt) => Some("\x1b[".to_string()),
|
|
||||||
("\\", AlacModifiers::Alt) => Some("\x1b\\".to_string()),
|
|
||||||
// ("]", AlacModifiers::Alt) => Some("\x1b]".to_string()),
|
|
||||||
("^", AlacModifiers::Alt) => Some("\x1b^".to_string()),
|
|
||||||
// ("_", AlacModifiers::Alt) => Some("\x1b_".to_string()),
|
|
||||||
("`", AlacModifiers::Alt) => Some("\x1b`".to_string()),
|
|
||||||
("{", AlacModifiers::Alt) => Some("\x1b{".to_string()),
|
|
||||||
("|", AlacModifiers::Alt) => Some("\x1b|".to_string()),
|
|
||||||
("}", AlacModifiers::Alt) => Some("\x1b}".to_string()),
|
|
||||||
("~", AlacModifiers::Alt) => Some("\x1b~".to_string()),
|
|
||||||
_ => None,
|
_ => None,
|
||||||
};
|
};
|
||||||
if manual_esc_str.is_some() {
|
if manual_esc_str.is_some() {
|
||||||
|
|
|
@ -141,7 +141,7 @@ pub struct TerminalSettingsContent {
|
||||||
pub alternate_scroll: Option<AlternateScroll>,
|
pub alternate_scroll: Option<AlternateScroll>,
|
||||||
/// Sets whether the option key behaves as the meta key.
|
/// Sets whether the option key behaves as the meta key.
|
||||||
///
|
///
|
||||||
/// Default: false
|
/// Default: true
|
||||||
pub option_as_meta: Option<bool>,
|
pub option_as_meta: Option<bool>,
|
||||||
/// Whether or not selecting text in the terminal will automatically
|
/// Whether or not selecting text in the terminal will automatically
|
||||||
/// copy to the system clipboard.
|
/// copy to the system clipboard.
|
||||||
|
|
|
@ -1252,7 +1252,7 @@ List of `integer` column numbers
|
||||||
"font_family": null,
|
"font_family": null,
|
||||||
"font_features": null,
|
"font_features": null,
|
||||||
"font_size": null,
|
"font_size": null,
|
||||||
"option_as_meta": false,
|
"option_as_meta": true,
|
||||||
"button": false,
|
"button": false,
|
||||||
"shell": {},
|
"shell": {},
|
||||||
"toolbar": {
|
"toolbar": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue