On the Mac, you can use the pbcopy/pbpaste commands to copy from and paste to the clipboard. It would be awesome if you could do something similar in iSH.
The way I see this working is through virtual devices, but maybe there's a more clever way to do it. On iOS, UIPasteboard stores clipboard entries as pairs of UTI (Universal Type Identifier) and content. So the ideal API is probably more complicated than simply reading and writing to a single virtual device.
Right now iSH supports copy and paste on the terminal, but that isn't as powerful as you're limited to text. The only way to get data in and out of iSH is currently the file system, which is less convenient in some cases.
I think the feature in itself is pretty cool, but it would also be very powerful to use together with Siri Shortcuts (#59).
iSH runs Linux, so xsel and xclip are good alternatives. But, they normally require a X window server which currently doesn’t supported by iSH.
A /dev/clipboard device would be pretty easy to add.
How would you go about reading from the clipboard?
I can write to it easily with echo foo > /dev/clipboard
But echo $(</dev/clipboard) doesn't seem to cut it… iOS tells me that text was pasted from the originating app, e.g. Apple Notes, but the ash in iSH doesn't print anything.
cat /dev/clipboard
Most helpful comment
A /dev/clipboard device would be pretty easy to add.