Add OSC52 clipboard support
Right now, Pyperclip-based clipboard integration does not work with tmux. Or, as far as I can determine, under anything else that does not set DISPLAY and install xclip and do bunch of other X11-specific things. Which is a shame, because Elia works so well on a headless system otherwise.
The “modern” solution to this problem is OSC 52 terminal codes, which most modern terminal emulators recognize. The proposed patch checks to make sure the existing Pyperclip solution is unlikely to work, and checks that /dev/tty is available (because sys.stdout seems to be unavailable or unreliable under Textual). Then it tries to use OSC 52.
This probably does not work on Windows.
The patch is a bit rough, partly because I’m not sure about the appropriate way to add helper code to Elia. It seems to work for me, though.