Don't send kitty kbd protocol probe until ECHO is disabled

With tmux 3.0 (from 2019) inside SSH, the CSI 5n response is echoed.
I guess with all other terminals we were just lucky.  Move it to
right after where we disable ECHO I guess.

In general, asynchronous requests create a lot of potential for error,
we should try to get away from them.
This commit is contained in:
Johannes Altmanninger
2025-01-05 17:53:09 +01:00
parent 109ef88831
commit 10f1f21a4f
3 changed files with 14 additions and 5 deletions

View File

@@ -451,6 +451,8 @@ macro_rules! kitty_progressive_enhancements {
};
}
pub const KITTY_PROGRESSIVE_ENHANCEMENTS_QUERY: &[u8] = b"\x1b[?u\x1b[5n";
static IS_TMUX: RelaxedAtomicBool = RelaxedAtomicBool::new(false);
pub static IN_MIDNIGHT_COMMANDER_PRE_CSI_U: RelaxedAtomicBool = RelaxedAtomicBool::new(false);
static IN_ITERM_PRE_CSI_U: RelaxedAtomicBool = RelaxedAtomicBool::new(false);
@@ -468,8 +470,6 @@ pub fn terminal_protocol_hacks() {
version < (3, 5, 6)
}),
);
// Request kitty progressive enhancement value and primary device attribute.
let _ = write_loop(&STDOUT_FILENO, b"\x1b[?u\x1b[5n");
}
fn parse_version(version: &wstr) -> Option<(i64, i64, i64)> {