T40: review round 1: a notification names the session as the output stands at its place: the tap follows OSC 0 and 2, the title stack's CSI 22 t and 23 t and a full reset as alacritty does, and sends each title in order, since alacritty's own title events come after the tap's; one write and split writes post the same
CI / platforms (ubuntu-24.04) (push) Successful in 1m21s
CI / platforms (windows-latest) (push) Successful in 1m48s
CI / macos (push) Canceled after 7m24s

This commit is contained in:
ZacharyZhang-NY committed 2026-10-17 16:06:10 -04:00
1 parent 52576bb8ee
commit 22752a28db
9 files changed
+247 -15

No files matched your search

+34
View File
@@ -9,6 +9,8 @@ fn scan(chunks: &[&[u8]]) -> Vec<String> {
found.push(match thing {
Found::Osc(body, _) => String::from_utf8(body.to_vec()).expect("utf-8"),
Found::Reset => "RESET".into(),
Found::Push => "PUSH".into(),
Found::Pop => "POP".into(),
})
});
}
@@ -225,3 +227,35 @@ fn the_tap_reads_mouse_modes_as_vte_does_byte_by_byte() {
}
}
}
#[test]
fn finds_the_title_stack_s_push_and_pop_as_vte_reads_them() {
assert_eq!(scan(&[b"\x1b[22;0t\x1b[23;2t"]), ["PUSH", "POP"]);
assert_eq!(
scan(&[b"\x1b[2", b"2:1\x07t\x1b[23t"]),
["PUSH", "POP"],
"across reads, a control run"
);
for other in [
&b"\x1b[?22t"[..],
b"\x1b[22$t",
b"\x1b[1;22t",
b"\x1b[t",
b"\x1b[22\x18t",
b"\x1b[24t",
] {
assert!(
scan(&[other]).is_empty(),
"{}",
String::from_utf8_lossy(other)
);
}
let mut many = b"\x1b[22".to_vec();
many.extend(std::iter::repeat_n(&b";1"[..], 32).flatten());
many.push(b't');
assert!(scan(&[&many]).is_empty(), "vte drops one past 32 fields");
assert_eq!(
scan(&[b"\x1b[22t\x1b]2;t\x07\x1b[23t"]),
["PUSH", "2;t", "POP"]
);
}