diff --git a/Home.png b/Home.png new file mode 100644 index 0000000..d3cab57 Binary files /dev/null and b/Home.png differ diff --git a/viewport/src/handle.rs b/viewport/src/handle.rs index f564cb8..94131e7 100644 --- a/viewport/src/handle.rs +++ b/viewport/src/handle.rs @@ -20,10 +20,14 @@ struct MacClipboard; impl clipboard::Clipboard for MacClipboard { fn read(&self, _kind: clipboard::Kind) -> Option { + // `from_utf8_lossy` rather than strict `from_utf8` — some rich-text + // clipboard sources produce stray bytes when pbpaste coerces their + // format to plain text, and a single bad byte would otherwise drop + // the whole paste. std::process::Command::new("pbpaste") .output() .ok() - .and_then(|o| String::from_utf8(o.stdout).ok()) + .map(|o| String::from_utf8_lossy(&o.stdout).into_owned()) } fn write(&mut self, _kind: clipboard::Kind, contents: String) {