mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-05 08:11:15 -03:00
Only initialize kitty keyboard capability on startup
If the initial query is interrupted by ctrl-c, we leave it unset. A later rogue "\e[?0u" reply would make us enable it, which seems surprising. Fix that by always setting the capability if we're gonna read from stdin.
This commit is contained in:
@@ -276,6 +276,7 @@ pub fn terminal_init() -> InputEventQueue {
|
||||
let mut input_queue = InputEventQueue::new(STDIN_FILENO);
|
||||
|
||||
let _init_tty_metadata = ScopeGuard::new((), |()| {
|
||||
maybe_set_kitty_keyboard_capability(false);
|
||||
initialize_tty_metadata(XTVERSION.get_or_init(WString::new));
|
||||
});
|
||||
|
||||
@@ -303,7 +304,6 @@ pub fn terminal_init() -> InputEventQueue {
|
||||
Implicit(CheckExit) => {}
|
||||
Implicit(QueryInterrupted) => break,
|
||||
CharEvent::QueryResult(Response(QueryResponse::PrimaryDeviceAttribute) | Timeout) => {
|
||||
maybe_set_kitty_keyboard_capability(false);
|
||||
break;
|
||||
}
|
||||
CharEvent::QueryResult(Response(_)) => (),
|
||||
|
||||
Reference in New Issue
Block a user