Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OSC52 clipboard support #83

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add OSC52 clipboard support #83

wants to merge 1 commit into from

Conversation

gcv
Copy link

@gcv gcv commented Dec 11, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant