Add some logging for XTGETTCAP

This commit is contained in:
Johannes Altmanninger 2025-01-06 21:09:41 +01:00
parent 14df28382d
commit cc9083e220
2 changed files with 19 additions and 2 deletions

View File

@ -1277,11 +1277,20 @@ pub trait InputEventQueuer {
}
buffer.pop();
buffer.pop();
// \e P 1 r + Pn ST
// \e P 0 r + msg ST
let buffer = &buffer[5..];
if !success {
FLOG!(
reader,
format!(
"Received XTGETTCAP failure response: {}",
str2wcstring(&parse_hex(buffer)?),
)
);
return None;
}
// \e P 1 r + Pn ST
let mut buffer = buffer[5..].splitn(2, |&c| c == b'=');
let mut buffer = buffer.splitn(2, |&c| c == b'=');
let key = buffer.next().unwrap();
let value = buffer.next()?;
let key = parse_hex(key)?;

View File

@ -2429,6 +2429,14 @@ impl<'a> Reader<'a> {
}
fn xtgettcap(out: &mut impl Write, cap: &str) {
FLOG!(
reader,
format!(
"Sending XTGETTCAP request for {}: {:?}",
cap,
format!("\x1bP+q{}\x1b\\", DisplayAsHex(cap))
)
);
let _ = write!(out, "\x1bP+q{}\x1b\\", DisplayAsHex(cap));
}