mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-23 21:31:14 -03:00
Fix regression causing fish_key_reader to not request modifyOtherKeys
If the kitty protcol is not supported, we still want to request modifyOtherKeys
and application keypad mode. Since 2d234bb676 (Only request keyboard protocols
once we know if kitty kbd is supported, 2025-01-26), fish_key_reader fails
to turn on those modes if the kitty keyboard protocol is not supported.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
//!
|
||||
//! Type "exit" or "quit" to terminate the program.
|
||||
|
||||
use std::{ops::ControlFlow, os::unix::prelude::OsStrExt};
|
||||
use std::{ops::ControlFlow, os::unix::prelude::OsStrExt, sync::atomic::Ordering};
|
||||
|
||||
use libc::{STDIN_FILENO, TCSANOW, VEOF, VINTR};
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
input::input_terminfo_get_name,
|
||||
input_common::{
|
||||
kitty_progressive_enhancements_query, terminal_protocol_hacks,
|
||||
terminal_protocols_enable_ifn, CharEvent, InputEventQueue, InputEventQueuer,
|
||||
terminal_protocols_enable_ifn, Capability, CharEvent, ImplicitEvent, InputEventQueue,
|
||||
InputEventQueuer, KITTY_KEYBOARD_SUPPORTED,
|
||||
},
|
||||
key::{char_to_symbol, Key},
|
||||
nix::isatty,
|
||||
@@ -96,10 +97,18 @@ fn process_input(streams: &mut IoStreams, continuous_mode: bool, verbose: bool)
|
||||
|
||||
while (!first_char_seen || continuous_mode) && !check_exit_loop_maybe_warning(None) {
|
||||
terminal_protocols_enable_ifn();
|
||||
let evt = queue.readch();
|
||||
|
||||
let CharEvent::Key(kevt) = evt else {
|
||||
continue;
|
||||
let kevt = match queue.readch() {
|
||||
CharEvent::Key(kevt) => kevt,
|
||||
CharEvent::Readline(_) | CharEvent::Command(_) => continue,
|
||||
CharEvent::Implicit(ImplicitEvent::PrimaryDeviceAttribute) => {
|
||||
if KITTY_KEYBOARD_SUPPORTED.load(Ordering::Relaxed) == Capability::Unknown as _ {
|
||||
KITTY_KEYBOARD_SUPPORTED
|
||||
.store(Capability::NotSupported as _, Ordering::Release);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
CharEvent::Implicit(_) => continue,
|
||||
};
|
||||
let c = kevt.key.codepoint;
|
||||
if verbose {
|
||||
|
||||
Reference in New Issue
Block a user