Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 installxclip
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 (becausesys.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.