Expand description
Terminal protocol, dropped-path, and native clipboard paste handling. Paste handling across terminal protocol, dropped-path classification, and OS clipboards.
[PasteEvents] implements the sans-I/O OSC 5522 conversation,
[dropped_paths] classifies terminal drops, and the clipboard functions
provide blocking native backends. Terminal and runtime integration belongs
beside crate::Terminal.
The clipboard functions block — subprocess bridges are killed after a few
seconds, but a wedged native clipboard (a dead X11 connection, a stuck
pasteboard) can hold them indefinitely. [spawn_clipboard_read] runs the
read on a detached thread reporting through a one-shot channel — never
tokio’s blocking pool, which cannot abort a running task and stalls
runtime shutdown behind it. Pair the receiver with a deadline to recover
from a hung native handle.
Structs§
- Paste
Events - Sans-I/O OSC 5522 (kitty enhanced paste) read-offer state machine.
- Pasted
Image - Raw image payload with its sniffed container format.
Enums§
- Clipboard
- Smart clipboard content, preferring image data over paths and text.
- Clipboard
Read - Scope of one background clipboard read.
- Paste
Progress - One step of the OSC 5522 conversation.
- Pasted
- A completed out-of-band paste delivered by the terminal or clipboard.
Functions§
- dropped_
paths - Classifies a dropped string as one or more absolute local paths.
- is_
image_ path - Returns whether a path has a supported image extension.
- read_
clipboard - Reads smart clipboard content, preferring image data, then file paths, then text.
- read_
clipboard_ text - Reads raw clipboard text.
- spawn_
clipboard_ read - Starts one background clipboard read on a detached thread, delivering the result through the returned one-shot channel.
- write_
clipboard_ text - Writes clipboard text, native backend first with CLI bridges as fallback.