-
-
Notifications
You must be signed in to change notification settings - Fork 601
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
Copy text using OSC52 #2548
Copy text using OSC52 #2548
Conversation
I'm also trying to get this into crossterm. If that were merged, we could consider using that instead. |
I’m going to add myself as a reviewer! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this PR on my Linux machine, using Alacritty, after having commented out the wl-copy
block, forcing the usage of escape codes.
From my side, everything looks good!
Awesome once the CI is green (minus the lints) I will merge. Thank you both! |
Copying logic seems too nested to comprehend with the introcution of two paths towards OSC52 otherwise.
0db0630
to
ac7e8da
Compare
CI failed as my split up copy function was only called on Linux and thus were marked as dead code on Mac OS and Windows. Should be fixed now.
|
50315d0
to
85d7018
Compare
I'm really sorry for bothering you because of build failures in CI, @extrawurst. My bad. I have now set up a CI run in my own namespace and, apart from |
@naseschwarz Thank you! |
This Pull Request closes #2366.
It changes the following:
This does not change the default behavior. On both wayland and X, wl-copy and xclip/xsel will be preferred. Only if one path fails, an OSC52 escape sequence will be issued.
I have tested this by running tmux, which has the option to turn support for this off and on (using
:set -g set-clipboard off
or:set -g set-clipboard on
) and SSH. When tmux's clipboard support was off, no text was copied. Once I enabled it, copying worked as expected. From this I conclude that the whole setup works as expected.N.B.: There is no easy path for gitui itself to check whether copying worked. Also, this essentially disables error reporting on wl-clip, xclip and xsel, as it acts as a fallback for these options.
I followed the checklist:
make check
without errors