T59: a click goes to a shell that takes clicks only past its prompt's last cell before the cursor, never on a prompt cell, so a click on fish's $ leaves its cursor where it stood

This commit is contained in:
ZacharyZhang-NY committed 2026-10-19 15:40:51 -04:00
1 parent 8dc8fbc51c
commit e74ea745fe
4 files changed
+47 -8

No files matched your search

+25
View File
@@ -114,6 +114,31 @@ fn a_shell_that_takes_clicks_hears_the_press_where_it_landed() {
"a row below goes too"
);
assert_eq!(sent(&typed, click(0, 1), false), None, "before the prompt");
assert_eq!(sent(&typed, click(1, 0), false), None, "on the prompt");
assert_eq!(
sent(&typed, click(1, 1), false),
None,
"on the prompt's space"
);
let past = sent(&typed, click(1, 15), false);
assert_eq!(
past.as_deref(),
Some("\x1b[<0;16;2M"),
"past the end, the shell decides"
);
let right = term(
20,
&format!("{marked}ls\x1b7\x1b[1;17H\x1b]133;A\x07~/a\x1b]133;B\x07\x1b8"),
);
assert_eq!(
sent(&right, click(0, 18), false),
None,
"a right prompt after the cursor"
);
assert_eq!(
sent(&right, click(0, 3), false).as_deref(),
Some("\x1b[<0;4;1M")
);
let two = term(
20,
"\x1b]133;A;click_events=2\x07~/src\r\n> \x1b]133;B\x07ls",