T66: files dropped on the terminal type their paths, which a user asked for after 0.1.6, as macOS Terminal does: each escaped for the shell, or quoted on Windows when it holds a space, followed by a space, sent as a paste; a path not in UTF-8 or holding a control character stops the drop; the font code moves from view.rs to fonts.rs, which view.rs needed room for; shot plays a drop with drop@x,y

This commit is contained in:
ZacharyZhang-NY committed 2026-10-19 16:40:49 -04:00
1 parent 390f2b6176
commit 545fb46249
10 files changed
+227 -76

No files matched your search

+14
View File
@@ -69,6 +69,20 @@ fn main() {
aim = settings.expect("a settings window");
capture::front(number(aim, cx)).expect("the window on screen");
}
spec if spec.starts_with("drop@") => {
let paths =
std::env::var("SHOT_DROP").expect("SHOT_DROP names the paths");
let event = typing::drop(&spec[5..], &paths).expect("a drop");
// A drag moves over frames before it lands.
for step in event {
aim.update(cx, |_, window, cx| window.dispatch_event(step, cx))
.expect("the window lives");
cx.background_executor()
.timer(Duration::from_millis(120))
.await;
}
log::info!("shot: dropped {paths:?} at {}", &spec[5..]);
}
spec => typing::post(spec, number(aim, cx)).expect("a key event"),
}
if spec.starts_with("to:") {