rjkroege/edwood

Really large clipboard contents don't paste

rjkroege opened this issue · 4 comments

Conceivably is a devdraw bug. Really big clipboards. e.g.

; pbpaste | wc
    7614   11706  208429

don't paste into Edwood. I'm guessing that devdraw is using the sync clipboard API and MacOS makes clipboards larger than a certain limit available only via the async flavour? <pbpaste will insert the clipboard contents successfully.

The whole devdraw snarf interface to the MacOS pasteboard is over-simplified. I recall writing that code long ago, and reviewing it now (after Russ has certainly rewritten it...), I see that we only deal with string types, and the concatenation of all the string type objects to start. I don' t know about a size limit on the strings, but it will miss on RTF, HTML, and other specialized clip types.
It's really not clear what to do about those, or about more complex types like images, without modernizing the snarf interface significantly to include type information.

As you note: there are some non-trivial work items to do something reasonable with HTML, images, etc. 😀

dnjp commented

I just ran into an issue that may or may not be related. If I open acme.go in edwood on MacOS, execute Edit , to select all of the text, execute Snarf, and B1+B3 to paste in a new file this is what gets pasted. This does not happen in plan9port acme. Do you think this is related or should I open a separate issue?

@dnjp I think that this is definitely the issue that you're seeing. Maybe #441 is related too. I've been ignoring this for a while now with Edit 1,$>pbcopy. I should fix.