laktak / extrakto

extrakto for tmux - quickly select, copy/insert/complete text without a mouse
MIT License
878 stars 45 forks source link

support xsel on linux #34

Closed laur89 closed 4 years ago

laur89 commented 5 years ago
laktak commented 4 years ago

Hi @laur89 and thanks for your PR!

What's the reason for xsel? https://askubuntu.com/a/898094/402745?

Also could you move the cleanup into a separate PR? Thank you!

laur89 commented 4 years ago

Reason is xclip doesn't work nice with neovim (maybe also affects vim, unsure). It's extremely minor thing, but annoying one. eg see

Think there's some interplay between xclip and clipboard manager. But easiest way was avoiding xclip altogether.

laktak commented 4 years ago

I use vim in the terminal so I can't say.

Are you sure that switching to xsel won't break it for existing users or do we need an option?

laur89 commented 4 years ago

That's a good question, and quite frankly i do not know. Wouldn't expect it to break anything - xsel, in my experience, works just fine; and if they don't have xsel then it'll fall through to try other options. I've been using extrakto from my branch and it's been just fine so far. Plus all the other ecosystem depending on xsel instead of xclip.

So my best guess is it's fine to go with it. But to make things safer/more flexible in the future, i think we should start using a config file to allow users to deviate from our defaults.

laktak commented 4 years ago

Choosing the clip tool is already an option, I've added it as a sample to the readme:

set -g @extrakto_clip_tool "xsel --input --clipboard" # works better for nvim

Does this work for you?

Because of the potential for breaking things I'm not going to accept the PR at this time. Thank you.

laur89 commented 4 years ago

Ah this is perfect, cheers.