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
This commit is contained in:
9 files changed
+247
-15
No files matched your search
@@ -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"]
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user