mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-11 22:21:14 -03:00
Work around keyboard-layout related bugs in WezTerm's modifyOtherKeys
modifyOtherKeys with non-English or other non-default keyboard layouts will cause wrong keys to be sent by WezTerm. Let's try to disable it for now. Proposed upstream fix: https://github.com/wezterm/wezterm/pull/6748 Closes #11204
This commit is contained in:
@@ -437,6 +437,7 @@ pub fn update_wait_on_sequence_key_ms(vars: &EnvStack) {
|
|||||||
static IN_ITERM_PRE_CSI_U: RelaxedAtomicBool = RelaxedAtomicBool::new(false);
|
static IN_ITERM_PRE_CSI_U: RelaxedAtomicBool = RelaxedAtomicBool::new(false);
|
||||||
static IN_JETBRAINS: RelaxedAtomicBool = RelaxedAtomicBool::new(false);
|
static IN_JETBRAINS: RelaxedAtomicBool = RelaxedAtomicBool::new(false);
|
||||||
static IN_KITTY: RelaxedAtomicBool = RelaxedAtomicBool::new(false);
|
static IN_KITTY: RelaxedAtomicBool = RelaxedAtomicBool::new(false);
|
||||||
|
static IN_WEZTERM: RelaxedAtomicBool = RelaxedAtomicBool::new(false);
|
||||||
|
|
||||||
pub fn terminal_protocol_hacks() {
|
pub fn terminal_protocol_hacks() {
|
||||||
use std::env::var_os;
|
use std::env::var_os;
|
||||||
@@ -457,6 +458,10 @@ pub fn terminal_protocol_hacks() {
|
|||||||
);
|
);
|
||||||
IN_KITTY
|
IN_KITTY
|
||||||
.store(var_os("TERM").is_some_and(|term| term.as_os_str().as_bytes() == b"xterm-kitty"));
|
.store(var_os("TERM").is_some_and(|term| term.as_os_str().as_bytes() == b"xterm-kitty"));
|
||||||
|
IN_WEZTERM.store(
|
||||||
|
var_os("TERM_PROGRAM")
|
||||||
|
.is_some_and(|term_program| term_program.as_os_str().as_bytes() == b"WezTerm"),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_version(version: &wstr) -> Option<(i64, i64, i64)> {
|
fn parse_version(version: &wstr) -> Option<(i64, i64, i64)> {
|
||||||
@@ -491,7 +496,7 @@ pub fn terminal_protocols_enable_ifn() {
|
|||||||
// Jetbrains IDE terminals vomit CSI u
|
// Jetbrains IDE terminals vomit CSI u
|
||||||
// iTerm fails to option-modify keys
|
// iTerm fails to option-modify keys
|
||||||
concat!("\x1b[?2004h", "\x1b[>4;1m", "\x1b=",)
|
concat!("\x1b[?2004h", "\x1b[>4;1m", "\x1b=",)
|
||||||
} else if IN_KITTY.load() {
|
} else if IN_KITTY.load() || IN_WEZTERM.load() {
|
||||||
// Kitty spams the log for modifyotherkeys
|
// Kitty spams the log for modifyotherkeys
|
||||||
concat!(
|
concat!(
|
||||||
"\x1b[?2004h", // Bracketed paste
|
"\x1b[?2004h", // Bracketed paste
|
||||||
@@ -524,7 +529,7 @@ pub(crate) fn terminal_protocols_disable_ifn() {
|
|||||||
concat!("\x1b[?2004l", "\x1b[>4;0m", "\x1b>",)
|
concat!("\x1b[?2004l", "\x1b[>4;0m", "\x1b>",)
|
||||||
} else if IN_JETBRAINS.load() {
|
} else if IN_JETBRAINS.load() {
|
||||||
concat!("\x1b[?2004l", "\x1b[>4;0m", "\x1b>",)
|
concat!("\x1b[?2004l", "\x1b[>4;0m", "\x1b>",)
|
||||||
} else if IN_KITTY.load() {
|
} else if IN_KITTY.load() || IN_WEZTERM.load() {
|
||||||
// Kitty spams the log for modifyotherkeys
|
// Kitty spams the log for modifyotherkeys
|
||||||
concat!(
|
concat!(
|
||||||
"\x1b[?2004l", // Bracketed paste
|
"\x1b[?2004l", // Bracketed paste
|
||||||
|
|||||||
Reference in New Issue
Block a user