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

Robust clipboard handling #61

Open
sternenseemann opened this issue Dec 12, 2024 · 0 comments
Open

Robust clipboard handling #61

sternenseemann opened this issue Dec 12, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@sternenseemann
Copy link
Contributor

See #60, #42. ad should figure out what tool to use for clipboard management dynamically. Ideally this should involve as little conditional compilation as possible for the sake of maintainability. A proof of concept can be taken from neovim which is implemented in vimscript.

We could probably implement something similar by adding a field to DefaultSystem that stores which tool to use. We'd then detect which is appropriate in DefaultSystem::new() or similar.

I think there are two related questions we at least think before we start reworking things:

  1. Most editors (including nvim, I think) are their own clipboard backends unless they are compiled as the GUI variant. As a GUI, you are basically guaranteed a working clipboard. In all other cases, the editor's internal clipboard is “just” synced with the system clipboard. This means that it is okay if no suitable tool is found to sync the clipboard. With ad's current approach, the editor is more or less unusable in such a situation (which isn't uncommon, think sshing into some server). I guess this depends on long term plans as well, i.e. will the TUI interface stick around forever?
  2. Wayland and X11 have a primary “clipboard” which stores the most recent selection in any program. Some users may expect this to work and it is sometimes necessary when interacting with programs that only use/support the primary selection.
@sternenseemann sternenseemann added the enhancement New feature or request label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant