-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Support primary clipboard #548
Conversation
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
As I mentioned in #532 please make these behaviors disable-able in the config. Although I do think we should support these behaviors for people who want them, it's also a behavior that really annoys some people (myself included). I actually go to great lengths to disable the behavior on my local Linux system, and having it hard-coded in Helix would subvert that in my now-primary editor. I'm even fine having it enabled by default. I just want to be able to disable it in my config. |
Sure, I'll do that option now |
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
I've decided not to use combined |
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
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.
LGTM, and tested on linux.
@@ -37,18 +69,24 @@ pub fn get_clipboard_provider() -> Box<dyn ClipboardProvider> { | |||
command_provider! { | |||
paste => "wl-paste", "--no-newline"; | |||
copy => "wl-copy", "--type", "text/plain"; | |||
primary_paste => "wl-paste", "-p", "--no-newline"; |
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.
Given that the config says middle_click_paste
, I'd rename all references in this file from primary
to middle_click
too.
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.
In terms of window systems (both X11 and Wayland) it's named primary selection
, as well as in tools used for access to it. Config option is for UI actually, and we still have commands for accessing both clipboards, so setting actually disables mouse behavior (copy on select and paste on middle click), not the buffer.
} | ||
} else if env_var_is_set("DISPLAY") && exists("xsel") && is_exit_success("xsel", &["-o", "-b"]) | ||
{ | ||
// FIXME: check performance of is_exit_success | ||
command_provider! { | ||
paste => "xsel", "-o", "-b"; | ||
copy => "xsel", "--nodetach", "-i", "-b"; | ||
primary_paste => "xsel", "-o"; | ||
primary_copy => "xsel", "-i"; |
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.
Is there a reason why --nodetach
is not used for the primary one?
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 has a freeze with it (xsel stuck untill I killed it via system monitor). It works fine without --nodetach
, not sure why it was necessary there. If I'm incorrect in removing that I can test it again and re-enable.
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 don’t know exactly why, but they use it in neovim
.
Exact command used is xsel --nodetach -i -p
(-p
is default as you know, so it’s identical except for the --nodetach
).
IIRC this is related to stdin/out stuff, but if it works without, I guess it’s fine 🤷♂️
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.
Should be okay. I'll leave this thread open for other reviewers.
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.
@CBenoit I don't think all neovim's options are directly portable. I had issues with wl-copy --foreground
for example since the command would never return and stall out: 994ff4b#diff-68b83255fe92299d6a62dcca53412b8976d5eda55d3640b4f0dcec474249ba27
How do I disable this in my [editor]
mouse = false But |
@cessen they are renamed to kebab-case ( |
@sh7dm Thanks! |
Fixes #532
Also some refactoring is done for fallback
TODO:
none
provider now stores buffer in memory for copy/paste inside the Helix instance)wl-copy
/wl-paste
xsel
pbcopy
/pbpaste
❌wl-copy
/wl-paste
✔️xclip
✔️xsel
✔️lemonade
❌doitclient
❌win32yank
❌termux
❌tmux
❌windows
❌