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

Clipboard fixes/improvements #405

Merged
merged 3 commits into from
Jun 16, 2024
Merged

Clipboard fixes/improvements #405

merged 3 commits into from
Jun 16, 2024

Conversation

vain
Copy link
Contributor

@vain vain commented Jun 16, 2024

Hi,

this addresses a couple of issues I saw in the clipboard area.

I could maybe live without b2a657d (could be considered a breaking change), but please see the commit message on why I think this is an improvement.

Thanks!

vain added 3 commits June 16, 2024 06:22
Previously, C-y pasted the "primary" selection on X11 and the
"clipboard" selection on Wayland. That's inconsistent and confusing,
especially when you're switching back and forth between the two.

This commit does two things:

1.  It makes C-y always paste the "clipboard" selection.
2.  It adds a key bind C-Y to paste the "primary" selection.

I suspect that most bemenu users are on Wayland, so this commit tries to
not break things for them. It does, however, change the behavior on X11.
First, this behavior now matches that of dmenu. People switching over
from dmenu might be used to this.

I would argue, though, that it is more comfortable in general anyway:

The "primary" selection is often easier to access, you can just select
some text and be done with it, no need to reach for C-c (or even C-S-c
in terminals). Some programs like XTerm can't even put text into the
"clipboard" selection without special configuration. It thus makes sense
to make this selection available with a hotkey that's easier to reach (I
find C-y to be much more comfortable than C-Y). Only in rare
circumstances do I need to access the "clipboard" selection.

In practice, this change is *probably* not a (very) breaking change for
users, because you very often have to select some text first using a
mouse (thus putting it into the "primary" selection) before you can put
it into the "clipboard" selection using something like C-c. This means
that pasting from "primary" almost acts as a "magic" hotkey that does
"the right thing".
On X11, not all programs offer this target, e.g. some terminals like
XTerm. The target "UTF8_STRING" has worked fine for many years and it is
what dmenu uses.

On Wayland, wl-paste supports the special type "text", which attempts to
autodetect a suitable type (in case there is no exact match for
"text/plain").
@Cloudef
Copy link
Owner

Cloudef commented Jun 16, 2024

Thanks, looks good. b2a657d I think it's bug if the original implementation did not match dmenu.

@Cloudef Cloudef merged commit 75122a0 into Cloudef:master Jun 16, 2024
3 of 4 checks passed
@vain
Copy link
Contributor Author

vain commented Jun 16, 2024

That was quick, thanks!

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.

2 participants