Upload screenshot, fixed bug with paste.

This commit is contained in:
jess 2026-04-15 10:04:19 -07:00
parent 18ff0a0525
commit 070723ff95
2 changed files with 5 additions and 1 deletions

BIN
Home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

View File

@ -20,10 +20,14 @@ struct MacClipboard;
impl clipboard::Clipboard for MacClipboard { impl clipboard::Clipboard for MacClipboard {
fn read(&self, _kind: clipboard::Kind) -> Option<String> { fn read(&self, _kind: clipboard::Kind) -> Option<String> {
// `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") std::process::Command::new("pbpaste")
.output() .output()
.ok() .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) { fn write(&mut self, _kind: clipboard::Kind, contents: String) {